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 bonu
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]
>
>
>
altendew wrote:
Im trying to create one query here. I know why its failing because CASE can
not be used like this, but how could I ever do a query like this.
[CODE]
SELECT b.*
FROM bonus b
JOIN
CASE b.type
WHEN 'custom' THEN 'bonusCustom g'
WHEN 'pts' THE
x27;pts' THEN 'bonusPts g'
WHEN 'ptc' THEN 'bonusPtc g'
END
ON g.bid=b.id
WHERE (b.hits IS NULL || b.hits>0)
ORDER BY RAND()
[/CODE]
Anyway this is possible!
--
View this message in context:
http://www.nabble.com/Selecting-Diff