mysql group_concat

来源:互联网 发布:电脑温度显示软件 编辑:程序博客网 时间:2024/06/04 19:24
$insertSql = " select max(case when goodtest.boxID = @idbox then  @title := CONCAT_WS(',',@title,goodtest.isotope)";
    $insertSql .= " else @title := goodtest.isotope end  ) as isotope,  ";   
    $insertSql .= "  @idbox:=goodtest.boxID as boxID  ";   
    $insertSql .= " from goodtest group by goodtest.boxID  ";       
    $query ="SELECT @title = NULL, @idbox = 0; ";   
    $query .= "INSERT INTO test(isotope, boxID)  ";


very very bad mysql!
原创粉丝点击