mysql基础 GROUP_CONCAT()
时间:2021-07-01 10:21:17
帮助过:4人阅读
GROUP_CONCAT(
CONCAT_WS(
‘---‘,
TRANSIT_PORT_EN,
IF
( TRANSIT_PORT_CODE IS NULL OR TRIM(TRANSIT_PORT_CODE)
= ‘‘,
‘无‘, TRANSIT_PORT_CODE ),
IF
( TRANSIT_ROUTE_CODE IS NULL OR TRIM(TRANSIT_ROUTE_CODE)
= ‘‘,
‘无‘, TRANSIT_ROUTE_CODE ),
IF
( TRANSIT_VESSEL IS NULL OR TRIM(TRANSIT_VESSEL)
= ‘‘,
‘无‘, TRANSIT_VESSEL ),
IF
( TRANSIT_VOYAGE IS NULL OR TRIM(TRANSIT_VOYAGE)
= ‘‘,
‘无‘, TRANSIT_VOYAGE )
)
ORDER BY
TRANSIT_SORT SEPARATOR ‘>>>‘
)
---- 不必须要 加 group by
mysql基础 GROUP_CONCAT()
标签:ESS tor mysql基础 concat_ws tran group by 基础 pre span