MySQL必備指令集

2021-09-24 00:15:06 字數 1031 閱讀 9036

列中僅選取唯一不同的值(distinct )

select distinct (tool_sub_type) from table where tool_type = 1 ;
三表聯查(and)
select * from table_1 t1 ,table_2 t2,table_3 t3 

where t1.store_id = t2.id and t2.company_id=t3.id;

三表聯查(left join)
select* from table_1 t1

left join table_2 t2 on t1.store_id = t2.id

left join table_3 t3 on t2.company_id = t3.id

從a表遷移部分資料到b表
update t_a a set 

a.seller_id =(select seller_id from customer_file b where b.id=a.customer_id ),

a.seller_name =(select name from customer_file b where b.id=a.customer_id ),

a.gmt_modified =now();

更新語句:
update table set tool_sub_type =9 where id = 2;
插入語句
insert into table(gmt_create,gmt_modified,parent_id,sub_name) value(now(),now(),1,"子類目");
不為空sql is not null
選取在 "address" 列中不帶有 null 值的記錄呢?

select lastname,firstname,address from persons

where address is not null

mysql bin指令集 mysql指令集

一 連線mysql。1 連線到本機上的mysql。首先開啟dos視窗,然後進入目錄mysql bin,再鍵入命令mysql u root p,回車後提示你輸密碼.注意使用者名稱前可以有空格也可以沒有空格,但是密碼前必須沒有空格,否則讓你重新輸入密碼.如果剛安裝好mysql,超級使用者root是沒有密...

MYSQL常用指令集

查詢 正在使用的引擎 show engines 查詢死鎖的表 show open tables where in use 0 查詢所有正在進行的執行緒 show full processlist 查詢 正在執行的事務 select from information schema.innodb trx...

gbip指令集 GB CPU 指令與指令集

gb cpu 指令與指令集 到目前為止,雖然 cpu 已經擁有了算術邏輯單元 alu 進行算術邏輯運算和使用暫存器儲存資料,但它仍然缺少一些正常工作時需要的資訊.就像建築工人無法僅僅依靠材料和工具憑空造出一棟高樓大廈,除非建築師能為其提供詳細的建築圖紙.cpu 也是一樣的,開發者需要通過某種方式告訴...