Mysql中字段為關鍵字,該怎麼處理

2021-10-02 05:21:51 字數 315 閱讀 2415

在做資料庫連線配置時,需要將資料庫連線的字段寫到資料庫表中,當插入新的資料庫資訊時,發現插入失敗。

字段內容為host,port,username,password,database,在資料庫中寫插入語句會發現部分欄位為關鍵字顏色。

解決方法,在關鍵字上加上反引號,如下,則能成功插入資料庫。

@insert("insert into datasource_config(`host`,`port`,username,`password`,`database`) values(" +

"#,#,#,#,#)")

mysql 中limit 關鍵字

一 基本 sql的limit語法的如以下形式 select from table limit offset rows rows offset offset 當省略offset 的時候,offset作為0 處理,表示提取查詢到的前 rows 條資料 當offse t 0時候,表示提取查詢到的 從off...

MySQL中any some all關鍵字

mysql中any some all關鍵字 any關鍵字 假設any內部的查詢語句返回的結果個數是三個,那麼,select from where a any select from where a result1 or a result2 or a result3 all關鍵字 all關鍵字與any...

MySQL 中 explain關鍵字

select 查詢的序列號,包含一組數字,表示查詢中執行 select 子句或操作表的順序。三種情況 id 相同 執行順序由上而下 from t1,t2,t3 where t1.id t2.id and t1.id t3.id and t1.other column from t2 where id...