[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

sql case statement

Posted on 2013-01-09
1
Medium Priority
?
295 Views
Last Modified: 2013-01-09
When the record is found then Found = 'Y' else Found ='N'. How do I do that in the select statement.

SELECT Found='Y'
-- [lien_id]
--      ,[title_app_id]      
  FROM [t21_maryland_dev].[dbo].[title_app_liens] a
  where a.[title_app_id] = 7599
0
Comment
Question by:Meinhoonaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
Guru Ji earned 2000 total points
ID: 38760649
SELECT CASE WHEN COUNT(1) > 0 THEN 'Y' ELSE 'N' END AS RecordFoundMessage
FROM [t21_maryland_dev].[dbo].[title_app_liens] a
  where a.[title_app_id] = 7599
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question