Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 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
52326 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  
 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.14 seconds. Powered By: Snitz Forums 2000