Re: order by 2 columns in ACE
Posted in 1995
Topics: SQL Development & Query Writing
In article <41dl2s$qd0@cssun.mathcs.emory.edu> rt10hp@csl.gov.uk (Richard Thomas) writes:
>Hi all,
>
>I'm trying to improve an ACE report, but it's doing my head in!!
>
>What I've got is one column where some entries are preceded by a "?",
>but I want to group by this column disregarding any "?"s. First of all
[stuff deleted]
If I'm understanding you correctly may you could do 2 selects and assign
a flag to "T" where col_1 != "?" and "F" otherwise; then, sort by the flag
before col_1
i.e.
select col_1,col_2,col_3,col_4,"T" flag
from table_1
where col_1 = "?"
union
select col_1,col_2,col_3,col_4,"F" flag
from table_1
where col_1 != "?"
order by flag,col_1
after group of flag
if flag = "T" then
begin
....
end
on every row
if flag = "T" then
begin
....
end
Bob Beaulieu
bobb@netcom.com
--
___________________________________________________________________
| _____ _____ ______ _____ _____ ___ ___ _____ __ |
|| ___| |_ / |_ _|| _ \\ / _ \\ \\ \\/ / | ___| | | |
|| ___| / /_ | | | / | _ | \\ / | ___| | |__ |
||_____| /_____| |__| |__|__\\ \\_/ \\_/ \\__/ |_____| |_____| |
|$Best Fares$...........Great Service........International/Domestic |
|Tel(408)978-0808 Fax:(408)978-7024 Internet: eztravel@netcom.com |
-------------------------------------------------------------------