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)
 SELECT CASE with query

Author  Topic 

tech
Starting Member

32 Posts

Posted - 2010-07-19 : 13:15:08
I am trying to do a certain type of query depending on the parameter passed in using a SELECT CASE.

Example:

WITH QuestionsEntries AS (
SELECT ROW_NUMBER() OVER (ORDER BY q.DateAsked DESC)
AS ROW, q.*
FROM Questions q

)
SELECT * FROM QuestionsEntries
WHERE ROW BETWEEN (@pageIndex - 1) * @pageSize + 1 AND @pageIndex * @pageSize
ORDER BY DateAsked DESC



But I need to do another where clause or order clause depending on the parameter being passed in.

how can I do this?

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-07-19 : 17:10:18
i don't understand what do you need/want?
where is another parameter? and what do you want to do with select case statement?
Go to Top of Page
   

- Advertisement -