Re: SQL ORDER BY as parameter
From: treok (h.k.j.keesmaat_at_chello.nl)
Date: 02/23/05
- Next message: Viatcheslav V. Vassiliev: "Re: Using parameters with the low level ADO API, trying to avoid the memory leaks."
- Previous message: Dave Blake: "Re: Using parameters with the low level ADO API, trying to avoid the memory leaks."
- In reply to: Bill Todd: "Re: SQL ORDER BY as parameter"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 23 Feb 2005 11:26:44 +0100
There is a possibility:
declare @TheOrder int
set @TheOrder = :param
select * from Table order by case
when @TheOrder = 0 then Field1
when @TheOrder = 1 then Field2 end
--- posted by geoForum on http://delphi.newswhat.com
- Next message: Viatcheslav V. Vassiliev: "Re: Using parameters with the low level ADO API, trying to avoid the memory leaks."
- Previous message: Dave Blake: "Re: Using parameters with the low level ADO API, trying to avoid the memory leaks."
- In reply to: Bill Todd: "Re: SQL ORDER BY as parameter"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]