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' 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-Different-Tables-Based-on-Value.-Case-seems-to-fail.-tf2943218.html#a8230082
Sent from the MySQL - General mailing list archive at Nabble.com.


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

Reply via email to