OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
RE: SELECT Query assistance please

From: Luc Foisy (Luc.Foisytechnical-magic.com)
Date: Thu Nov 13 2003 - 13:08:47 CST


Got it, thanks

SELECT PROJECTCODE.ID AS 'ID', PROJECTCODE.Name AS 'Reference', EVENT.ID, EVENT.ID_PROJECTCODE FROM PROJECTCODE LEFT JOIN EVENT ON PROJECTCODE.ID = EVENT.ID_PROJECTCODE WHERE EVENT.ID IS NULL ORDER BY PROJECTCODE.Name

-----Original Message-----
From: Luc Foisy
Sent: Thursday, November 13, 2003 2:01 PM
To: MYSQL-List (E-mail)
Subject: SELECT Query assistance please

I have two tables EVENT and PROJECTCODE

EVENT.ID
EVENT.ID_PROJECTCODE

PROJECTCODE.ID
PROJECTCODE.Name

EVENT PROJECTCODE
ID = 1 ID_PROJECTCODE = 0 ID = 1
ID = 2 ID_PROJECTCODE = 0 ID = 2
ID = 3 ID_PROJECTCODE = 1 ID = 3
ID = 4 ID_PROJECTCODE = 4 ID = 4

SELECT PROJECTCODE.ID AS 'ID', PROJECTCODE.Name AS 'Reference' FROM PROJECTCODE

Not quite sure on the join or where claus here, I tried 3 or 4 different ways and can't seem to get what I want.
What I want out of the results is PROJECTCODE.ID = 2 and 3, that being all records in PROJECTCODE that do not appear in EVENT

Luc

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=luc_foisytechnical-magic.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql