Skip to content Skip to sidebar Skip to footer

Alias With Order By

I have a query : SELECT distinct(a0.ID,a0.str) from sev_modul_4_type1 as a0 where ((lower(a0.str) LIKE '%а%')) And i want to order it by str but if do it like that select * f

Solution 1:

select*from (
   SELECTdistinct a0.ID, a0.str  
   from sev_modul_4_type1 as a0 
   where ((lower(a0.str) LIKE'%а%'))
) x orderby x.str desc

Try removing the parenthesis from distinct and then using the alias in your ORDER BY clause.

Solution 2:

Try this way

select*from (
   SELECTdistinct a0.ID,
                a0.str  
   from sev_modul_4_type1 as a0 
   where ((lower(a0.str) LIKE'%а%'))
) x orderby str desc

Post a Comment for "Alias With Order By"