UNION

2003-09-11 Thread Andy Jefferson
Hi, I'm trying to do a simple UNION in MySQL (4.0.11a on Linux). I am trying the following ... If I do SELECT THIS.PRODUCT_ID,"net.ajsoft.WebShop.Inventory.Product" AS JPOXMETADATA,THIS.ID FROM PRODUCT THIS LEFT OUTER JOIN BOOK SUBCLASS0 ON THIS.PRODUCT_ID = SUBCLASS0.BOOK_ID WHERE SUBCLASS0.BOOK

Re: UNION

2003-09-12 Thread Andy Jefferson
>> If I do >> SELECT THIS.PRODUCT_ID,"net.ajsoft.WebShop.Inventory.Product" AS >> JPOXMETADATA,THIS.ID FROM PRODUCT THIS LEFT OUTER JOIN BOOK SUBCLASS0 ON >> THIS.PRODUCT_ID = SUBCLASS0.BOOK_ID WHERE SUBCLASS0.BOOK_ID IS NULL AND >> THIS.PRICE < .15E3 >> i get >> ++-

InnoDB & MySQL-4.0.11a using Linux Mandrake RPMs

2003-09-23 Thread Andy Jefferson
Hi, a simple question ... I have MySQL installed on my Mandrake Linux system, via the RPM's MySQL-4.0.11a-5.1mdk MySQL-common-4.0.11a-5.1mdk MySQL-client-4.0.11a-5.1mdk Can anyone tell me how a) I check if InnoDB is available with this version ? (in the RPM release notes it seems InnoDB was inclu

Re: InnoDB & MySQL-4.0.11a using Linux Mandrake RPMs

2003-09-23 Thread Andy Jefferson
Andy Jefferson wrote: > a simple question ... I have MySQL installed on my Mandrake Linux system, > via the RPM's > MySQL-4.0.11a-5.1mdk > MySQL-common-4.0.11a-5.1mdk > MySQL-client-4.0.11a-5.1mdk > > Can anyone tell me how > a) I check if InnoDB is available wi

Re: Sub-selects

2003-09-24 Thread Andy Jefferson
[EMAIL PROTECTED] wrote: > According to documentation, in MySQL version 4.0, it is possible to use > sub-selects, but i haven't found the correct syntax... Does any one know > how to do this? > I need someting like this: > > Select a, (select sum(b) from T2 where T2.a=T1.a) as b from T1 In MySQL

JDBC : determining the schema name for MySQL

2003-09-28 Thread Andy Jefferson
Hi, has anyone found a good way of determining the schema name using a JDBC connection to MySQL ? I've tried accessing DatabaseMetaData and calling getSchemas() to get the schemas and it returns nothing using 3.0.8 of the connector. I've also tried tried DatabaseMetaData.getTables() and grab the

Re: JDBC : determining the schema name for MySQL

2003-09-28 Thread Andy Jefferson
Mark Matthews wrote: > MySQL doesn't have schemas (currently). They are being developed in a > future version. The DatabaseMetaData interface in JDBC has a method, > 'getSchemaTerm' which tells you whether a certain database supports > schemas or not (returning "" when schemas are not supported). M

EXISTS : in MySQL 4.0.* ?

2004-04-28 Thread Andy Jefferson
Hi, I'm using MySQL 4.0.15 and have been trying to use EXISTS/NOT EXISTS ... with no success - getting "You have an error in your SQL syntax". I've got 2 tables A and B and am trying something like this SELECT THIS.A_ID FROM A THIS WHERE NOT EXISTS (SELECT THIS_ITEMS.B_ID FROM B THIS_ITEMS WHE

MySQL 4.0.15 : Foreign Key - ERROR 1005 (errno: 150)

2004-05-05 Thread Andy Jefferson
Hi, I've got 2 tables in a circular dependency as follows CREATE TABLE USERDETAILS ( USERDETAILS_ID BIGINT NOT NULL, FORENAME VARCHAR(30) BINARY NULL, SURNAME VARCHAR(30) BINARY NULL, USER_USER_ID_OID BIGINT NULL, PRIMARY KEY (USERDETAILS_ID) ) TYPE=INNODB CREATE TABLE `USER`