It will look something like the following. Also, you are using COUNT, you should use SUM if you want the total amount of money
Code:SELECT name, CASE WHEN SUM(money) > 5 THEN 'lots of money' ELSE 'running low' END FROM mytable GROUP BY member_id;
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 4 of 4
Thread: mySQL Query HelpThreaded View
|
Click Here to Expand Forum to Full Width |