database - Every derived table must have its own alias error in MySQL -


i have following query:

select sum( cost )  (  select s.cost sandwiches s s.name =  "cheese steak" ) union (  select p.cost pizza p type =  "plain" , size =  "l" ) 

that gives me error of:

#1248 - every derived table must have own alias

you need alias temp tables

select sum( cost )  (   (   select s.cost   sandwiches s   s.name =  "cheese steak"   ) t1 union    (   select p.cost   pizza p   type =  "plain"   , size =  "l"   ) t2 ) t 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -