group_concat 의 용법 및 주의 점
2016 단어 MySQL
group_concat “,”, , SEPARATOR ,
:
mysql> SELECT student_id, GROUP_CONCAT(courses_id SEPARATOR '@#$') AS courses FROM student_courses WHERE student_id=2 GROUP BY student_id;
, , courses_id :
mysql> SELECT student_id, GROUP_CONCAT(courses_id ORDER BY courses_id DESC) AS courses FROM student_courses WHERE student_id=2 GROUP BY student_id;
1.int
group_concat , int , char , (ExecuteScalar SQL ) , byte[]。 SQLyog , 。 select group_concat(ipaddress) from t_ip select group_concat(id) from t_ip byte[] select group_concat(CAST(id as char)) from t_dep select group_concat(Convert(id , char)) from t_dep Cast,convert : CAST(expr AS type), CONVERT(expr,type) , CONVERT(expr USING transcoding_name) CAST() CONVERT() , 。 : BINARY[(N)] CHAR[(N)] DATE DATETIME DECIMAL SIGNED [INTEGER] TIME UNSIGNED [INTEGER] 2.
group_concat , 。 。 group_concat_max_len , 。 , val : SET [SESSION | GLOBAL] group_concat_max_len = val; , 。 SQLyog SET GLOBAL group_concat_max_len = 10 , SQLyog, 。 ( , ) )
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Redash를 사용할 때 몰랐던 SQL을 쓰는 법을 배웠습니다.최근 redash에서 sql을 쓸 기회가 많고, 이런 쓰는 방법이 있었는지와 sql에 대해 공부를 다시하고 있기 때문에 배운 것을 여기에 씁니다. Redash란? 월별로 데이터를 표시하고 싶습니다 주별로 데이터를 표...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.