Hi, To answer or see the answer, go to http://stackoverflow.com/questions/23469186/using-alias-in-order-by-clause-in-h2db
Regards, Thomas On Mon, May 5, 2014 at 10:44 AM, Александр Салтыков < [email protected]<javascript:_e(%7B%7D,'cvml','[email protected]');> > wrote: > Hi everyone, > I try to use column alias in IOREDR BY clause but without much success. > I try to test my query that I am using in MySQL DB > my query is follow: > > select a.name as name, b.code > from t1 > where t1.total>50 > order by UPPER(name) > > but I've got exception that Column "name" not found > > If I use the query like this: > > select t1.name as name, t1.code > from t1 > where t1.total>50 > > union > > select t2.name as name, t2.code > from t2 > where t2.total>50 > > order by UPPER(name) > > I've got exception: > Order by expression "UPPER(name)" must be in the result list in this case > > Could say anyone how I can test such queries using h2 database. > Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to > [email protected]<javascript:_e(%7B%7D,'cvml','h2-database%[email protected]');> > . > To post to this group, send email to > [email protected]<javascript:_e(%7B%7D,'cvml','[email protected]');> > . > Visit this group at http://groups.google.com/group/h2-database. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
