altendew wrote:

What do you mean assemble the SQL in Code.
I am using MYSQL 4.1 and PHP.

Ah. Looking closer, I see that you're not using an outside variable in the CASE bit. Sorry about that. Should have read closer.

In your FROM clause, you could have stuff like:

FROM bonus b
JOIN bonusCustom on b.id = bonusCustom.bid
JOIN bonusPts on b.id = bonusPts.bid
JOIN bonusPtc on b.id = bonusPtc.bid

... or possibly left join, as I said in the previous email.

But then you're not actually selecting anything from the bonus* tables, so I don't see a lot of point in joining to them to start with, unless you're just trying to limit your results ... and if you are, you'll have more work still. Why are you joining to the bonus* tables?

Personally, I'd put all the bonus* tables in *one* table, and have a field to specify what type of bonus it is. Then you wouldn't have to jump through hoops to join to the right table.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

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

Reply via email to