mybatis常用語句

2021-10-20 01:13:21 字數 623 閱讀 1021

插入資料獲取最近插入的id:

sekectkey

//使用selectkey

values (#,#)

select

查詢包含語句

concat 用於將兩個字串連線起來,形成乙個單一的字串。

replace函式:是用第三個表示式替換第乙個字串表示式**現的所有第二個字串表示式的方法。

語法:replace ( string_expression , string_pattern , string_replacement )

concat('%',replace(replace(#,'%','\%'), '_', '\_'),'%')
select * from t_user where name like concat('%',replace(replace(#,'%','\%'), '_', '\_'),'%')
mybatis迴圈

#

mysql常用語句 MySQL常用語句

create table student id int primary key auto increment comment 學號 name varchar 200 comment 姓名 age int comment 年齡 comment 學生資訊 修改表注釋 alter table studen...

php mysql 常用語句 mysql常用語句

一 修改mysql使用者密碼 mysql h localhost u root p 命令列登入 update user set password password 123456 where user root 二 資料庫操作 show databases 顯示資料庫 create database ...

MyBatis常用語法

1 將查詢出的結果為null 的轉換為0coalesce sum s.num 0 2 null 賦值ifnull name,0 2 對二進位制位判斷位數 status 二進位製欄位 and s.status 1 0 第一位為1 and s.status 2 0 第二位為1 and s.status ...