MemoryRefresh!

Query / Concat fields     Concat fields



Questions Answers 0%

Pages   0 from 12
Questions   0 from 14

Reset


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'

Related Pages

Order by rand
Concat fields
Select search
Regexp
If null
Union


0% 100%
 
 
0 pages 12 pages
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'





Programming

Php
   
Regex
   
MySQL
   
Css
   
jQuery
   
Git
   


References
n/a