-- 查询语句select class from stu_info where sid=1000000102;select * from stu_info t where t.age=88; -- t是表的别名,多表查询时比较方便select * from atable a, btable b where a.aID = b.bID;select * from stu_info t where t.age=99 or (t.age>20 and t.age <90);select * from…
case函数 语法: CASE WHEN a THEN b [WHEN c THEN d]* [ELSE e] END 说明:如果a为TRUE,则返回b:如果c为TRUE,则返回d:否则返回e 实例 hive> case when salary is null then "- -" else salary end from stg_job #salary为空则转换成 - -,不是则不做改变 hive> case when (job_location like '%北京%'…
折腾了半天终于把这个给折腾顺了,但是后来发现用不了竟然...悲剧啊,但是还是要记录下加深记忆 insert into table1 (field1, field2,field3) select ?field1,?field2,?field3 from temp where not exists (select field1,field2,field3 from table1 where field1=?field1 and field2=?field2 and field3=?field3);…