Connecting Tech Pros Worldwide Help | Site Map

Case + order by

Newbie
 
Join Date: Sep 2008
Posts: 1
#1: Sep 18 '08
Can anybody help me that for different select options as follows
___ Name
___ Age
___ Address
___ Place

how I will arrange his in sort order according to user enters and which i need to select from a database file.

Like select * from table where conditions order by ???????????

How I can handle this situation?

Regards,
Renjith
Moderator
 
Join Date: Mar 2006
Posts: 1,103
#2: Sep 18 '08

re: Case + order by


How are you passing the input from the user to your program?

How are you forming the query? Can you use a stored procedure and a switch on the value passed in?

eg if it's name, run this query
if it's age, run this query, etc..
Reply