SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Constant value in a query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Vadz
Starting Member

Fiji
11 Posts

Posted - 12/12/2012 :  20:42:00  Show Profile  Reply with Quote
hi

i have this value
tom = 100
Ken =50

those to value a my constant value. so when i enter a value greater than both it will return enter another value.i am asking how to do sql query to have a constant value

thanks

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 12/14/2012 :  04:09:00  Show Profile  Reply with Quote
use CASE WHEN

CASE YourField
WHEN 'tom' THEN 100
WHEN 'Ken' THEN 50
ELSE <other value here>
END AS yourColName

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000