ExpertRefresh

Query / Concat fields  

Related Pages

Order by rand
Concat fields
Select search
Regexp
If null
Union
Using syntax
Ucfirst


0.0% 100%
 
 
0 pages 19 questions
1) How do you serialize field values?




2) How do you concat multiple fields?







GROUP_CONCAT SELECT GROUP_CONCAT(ancestor) AS ancestors FROM catg_path WHERE descendant=7 //ancestor: 2,5,7 SELECT GROUP_CONCAT(ancestor SEPARATOR ' / ') AS ancestors FROM catg_path WHERE descendant=7 //ancestors: 2 / 5 / 7 SELECT GROUP_CONCAT(ancestor ORDER BY ancestor DESC SEPARATOR ' / ') AS ancestors FROM catg_path WHERE descendant=7 //ancestors: 7 / 5 / 2 CONCAT_WS SELECT CONCAT_WS(" / ", catg, subcatg) FROM catg WHERE catg='programming'; // jQuery / MySQL / PHP CONCAT // returns NULL if any argument is NULL SELECT CONCAT('My', 'S', 'QL'); // Output: 'MySQL'


References



n/a