Update base_ct set ct=null where id=1;
Select address||’kong’|| ‘ ’||id from address;
Select last_name aa from address;//大写显示标题
Select las_name AS “aa” from address;//栏位保持不变 aa
Like 区分大小写;
Select * from t1 where id
Between 10 and 20 and name is (not) null and id not in(10,20,5,6);
Select lower(al_name ),upper(fname) from auther;
Select concat(‘hello’,name) from auther;//连接诶
Select substr(lname,1,5) from auther//从第个截取5个;
Instr(lname,’w’)判断存在位置; lpad(au_name,15,’&’)左填充&到15位长度;
Round(45.926,2)求余,trunc(45.923,2)截取
Nvl(name,’tom’)//是否位空空,如实是就用后面的填充,否则返回原值。
Nvl2(name,‘have name’,’have not name’)
Nullif(name1,name2)如果相等返回空,否贼返回第一个;
Cocalesce(,,,,)直到找到第一个不为空的值。
Natural join aa;依据aa同名的栏位连接;
Using(aa,bb)依据多个栏位同名连接;
Left outer join
Create view testview
As
Select stor_id,qty;
Select * from testview;
Select * from sales union select * from sales,集合操作;排序,删除重复
Select * from sales1 union all select * from sales2 不删除重复,不排序
Select * from sales1 intersect all select * from sales2求交集
Select * from sales1 minus all select * from sales2第一句减去交集;
Insert all
When name like ‘b%’ then into t1,
When name like ‘c%’ then into t2,
Select * from sales;