>sele FIELD_LIST ; > from TBALE1 ; > join TABLE2 ; > join TABLE3 ; > where something ; > AND something else ; > UNION ; >sele FIELD_LIST > from TBALE1 ; > join TABLE2 ; > join TABLE3 ; > where something ; > AND something else ; > into cursor temp2 nofilter >You query should be like this:
sele COLUMN_LIST ; from TBALE1 ; join TABLE2 ; join TABLE3 ; where something ; AND something else ; UNION ; sele COLUMN_LIST from TBALE1 ; join TABLE2 ; join TABLE3 ; where something ; AND something else ; ORDER BY 2, 4, 1 into cursor temp2 nofilterThe ORDER BY clause goes on the LAST SELECT. Where 2, 4, 1, are the order of the columns your whole query will be ordered by. In other words: ORDER BY column2, column4, column1.