成人无码视频,亚洲精品久久久久av无码,午夜精品久久久久久毛片,亚洲 中文字幕 日韩 无码

資訊專欄INFORMATION COLUMN

【mysql】[error]group_concat造成的sql語法錯(cuò)誤

littleGrow / 3691人閱讀

摘要:錯(cuò)誤實(shí)例完整錯(cuò)誤原因中多了一個(gè)逗號(hào)執(zhí)行結(jié)構(gòu)有大小限制,會(huì)根據(jù)大小進(jìn)行截取參考手冊(cè)

sql錯(cuò)誤實(shí)例
$sql_id = "select group_concat(`table_a_id`) from `table_b`";
$id_str = $db->execute($sql_id);

$sql = "select * from `table_a` where `id` in ( {$id_str} ) and `is_effect` = 1`";
$res = $db->execute($sql);

/*  
    error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right 
    syntax to use near ") and `is_effect` = 1"
*/
// 完整sql: select * from `table_a` where `id` in ( 1,2,3,4, ) and `is_effect` = 1`
錯(cuò)誤原因

sql中多了一個(gè)逗號(hào)
group_concat 執(zhí)行結(jié)構(gòu)有大小限制,會(huì)根據(jù)byte大小進(jìn)行截取

參考:mysql手冊(cè)-group_concat

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://m.hztianpu.com/yun/30436.html

相關(guān)文章

發(fā)表評(píng)論

0條評(píng)論

閱讀需要支付1元查看
<