In MySQL, a certain field of the query result set is spliced into a string

  group_concat: concatenate a field of the query result set into a string

  SELECT GROUP_CONCAT(t.cabinet_no SEPARATOR ';') FROM tb_stockorder t WHERE t.id
  IN(
  'INV20060300015',
'INV20060300019',
'INV20060300021',
'INV20060300023',
'INV20060300031',
'INV20060300033',
'INV20060300038')

 

Guess you like

Origin blog.csdn.net/y_bccl27/article/details/114626401