DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   Getting current value in Select Statement (http://www.daniweb.com/forums/thread21230.html)

milman Mar 31st, 2005 4:36 pm
Getting current value in Select Statement
 
Is there a way to get the current value in the process of a select statement?

Such as

SELECT pk_ID, columnN
and be able to evaluate what pk_ID is at this point
WHERE This = That

Drew Apr 9th, 2005 8:46 pm
Re: Getting current value in Select Statement
 
What is it that you are trying to do? :s

gminhas Apr 12th, 2005 7:52 am
Re: Getting current value in Select Statement
 
yes u can..

SELECT pk_ID, columnN,(case when columnM is '1' then TableName.pk_ID else '0' end) as columnM from TableName
WHERE This = That

This is just an example..wat u can do is use the TableName.ColumnName anywhere..

if any more issues..get back to me..


All times are GMT -4. The time now is 2:19 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC