I have a table with sample datas, as follows,
organization, first_name, last_name, country, date, published, hide_me
xyz, Steve, Small, Hungary, 2014-04-01, 1, 0
zxy, Rob, Big, England, 2014-04-02, 0, 0
yxz, Bob, Middle, Germany, 2014-04-03, 1, 1
I am using this query:
SELECT `organization`, `first_name`, `last_name`, `country`, date(`created_date`) FROM `jos_jd_donors` WHERE `published`=1
The result is
xyz, Steve, Small, Hungary, 2014-04-01
yxz, Bob, Middle, Germany, 2014-04-03
Help me please to create a query, when the hide_me=1, and the result should look like this one:
xyz, Steve, Small, Hungary, 2014-04-01
Anonimous, " ", " ", Germany, 2014-04-03
The name of organization should be changed to Anonimous, the names whould be empty strings. I tried to use the SELECT CASE but no success.
Best regards,
Pista
|