If you want the data in the campaigns table regardless if an entery exists
int he addresses_incampaign table then you should use a LEFT OUTER JOIN.

-----Original Message-----
From: Scott Haneda
To: MySql
Sent: 8/2/04 7:37 PM
Subject: Cant get this JOIN to work

tSql = "SELECT c.campaign_name, c.id
FROM campaigns as c
INNER JOIN addresses_incampaign as i on (c.user_id = i.user_id)
WHERE c.user_id = " & prepSQL(tConn, user_id) & "
GROUP BY c.id";

This works when there is data in the addresses_incampaign table, but
when
there is not, it returns nothing, which is not what I want.
-- 
-------------------------------------------------------------
Scott Haneda                                Tel: 415.898.2602
http://www.newgeo.com                       Fax: 313.557.5052
[EMAIL PROTECTED]                            Novato, CA U.S.A.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to