亚洲中字慕日产2020,大陆极品少妇内射AAAAAA,无码av大香线蕉伊人久久,久久精品国产亚洲av麻豆网站

資訊專欄INFORMATION COLUMN

【mysql】[error]group_concat造成的sql語法錯誤

littleGrow / 3690人閱讀

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

sql錯誤實例
$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`
錯誤原因

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

參考:mysql手冊-group_concat

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

轉(zhuǎn)載請注明本文地址:http://www.ezyhdfw.cn/yun/30436.html

相關(guān)文章

發(fā)表評論

0條評論

最新活動
閱讀需要支付1元查看
<