[Zope] re: SQL Unions.

Jim Sanford jsanford@atinucleus.com
Mon, 17 Jan 2000 19:36:54 -0600


When using union the order by clause needs to us a number denoting the column number instead of a column name 

try:
select brand
from tableofitemsoftype1
union
select brand
from tableofitemsoftype2
group by 1.

----- Original Message ----- 
From: Brenton Bills <fud@mail.theinternet.com.au>
To: <zope@zope.org>
Sent: Monday, January 17, 2000 3:47 PM
Subject: [Zope] re: SQL Unions.



Hi people,
I have been attempting to do an SQL union from an ZSQL Method with
MysqlDA as my back end database. The only problem is I cant seen to get it
to work.

Are unions a bad thing? Should I be using something else.

Eg. Get all the brands we have in our database.

select brand
from tableofitemsoftype1
union
select brand
from tableofitemsoftype2
group by brand.

From what I understand this would get all of the brands and group them
together and place them in a single column results table? 


_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )