Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i have select like this: select

Status
Not open for further replies.

raji96

Programmer
Aug 7, 2001
64
US
i have select like this:

select studentname,studentid,orderby
from student

and i have order by the select statement based onthe values stored in orderby field,for example if orderby has "studentname,studentid" then i have to sort it by that,how do i do that is there anything like this

select studentname,studentid,orderby
from student
order by &orderby

 
The only way to do this is to use dynamic sql.
As for your question, if orderby is the field of student table, how can you sort if the values of orderby are different?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top