Sort SQL Data after the amending it....

Hi

I've a SQL, which is fetching data from multiple tables. Depending on a condition, i'm changing one of the column data to A-Z, just leaving one unique name in the data as in the filter(Data Hiding).

Now, i also want to sort this data as per their values in Desc order ?

Any inputs please


Regards

Sunil Babar

Hi Sunil,

You can use order by <number> DESC

where <number> is the position of the column in the field list where you want to sort on.

for example:

SELECT Name, Street, PostalCode From Address ORDER BY 3 DESC

Will sort descending on PostalCode

You can try and play with this: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_orderby

Regards,

Daniel

Hi Daniel

Thanks for your response...

I tried Order by, however did not work.  Where m stuck is, Like stated above, in my preparation first my SQL executes and then depending on the condition is change the data fetch by SQL.  Once this is done, i want to apply the sort.

Regards


Sunil Babar

Hi Sunil,

I am afraid not to fully understand what you do, could you provide your preperation?

If you want to sort the result of your advanced SQL you could consider using ListSort.

Regards,

Daniel