Q&A about the site for administrators, end users, developers and designers for Craft CMS
--select users coming from China, India and USA -- AFTER checking the logicalmodel, the user table has all information we need /*select * from Users where Location like '%China' OR Location like '%India' OR Location like '%USA' */ --rewrite by using case title /*select Id,Location, 'country coming from' = case when Location like '%India' then 'coming from India' when Location like '%China' then 'coming from China' when Location like '%USA' then 'coming from USA' when Location is null then 'no location information' ELSE 'coming from other countries' end from Users */ --generate a frequency table from reputation select count(Id) from Users group by reputation