ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • MYSQL GROUP CONCAT 을 서브쿼리에서 IN 조건으로 찾을때 첫번째 값만 가져오는경우
    카테고리 없음 2016. 7. 27. 11:34

    SELECT * FROM TABLE WHERE 

    FIND_IN_SET(찾을 컬럼명,GROUP_CONCAT(필드))





    down voteaccepted

    MySQL is seeing the subquery return only a single field/row, and therefore treats it as something like:

    ... and A.id IN ('1,2,3,4')

    which boils down to A.id = '1,2,3,4'.



    출처

    http://stackoverflow.com/questions/6403074/group-concat-in-in-subquery



Designed by Tistory.