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

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 selecting rows based on a variable

Author  Topic 

smithani
Starting Member

42 Posts

Posted - 2007-06-07 : 16:39:04
Hi All


I want to select a certainnumber of rows

select custno, amt, balance from customer where custno='customerno'
when showcust='r' then select rows where amt<balance
when showcust='c' then amt>balance etc
if showcust='' then show everything


Any insight will be greatly apprecaited.
Thanks

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-06-07 : 16:58:03
please do not duplicate posts..http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=84711

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -