SQL语句的一些常用场景 1。where。。。in。。。查找固定的值,如查找table中id为1,2,3的数据行 selectfromtable whereidin(1,2,3); 2。tableAleftjointableBon条件 当满足条件的时候,将数据表B拼在数据表A上,如将tableA和tableB里id相同的数据行拼在一起,如果A有数据B没有则B对应的数据显示为空 selectA。idfromtableAleftjointableBonA。idB。 3。oracle数据库中leftjoin的另外一种写法 selectA。idfromtableA,tableBwhereA。idB。id(); 4。date的处理方式,将取出的数据类型转换为想要的类型,如从table中选取今年2月份的数据 selectfromtableAwheretochar(a。createdate,yyyymm)202202; 注意:oracle中字符串表示的符号是单引号 5。多行注释 123hr 单行注释 123