select * from products where id in(select id from cats where name like '%java%');//查找类型中名字中包含java的的商品信息 order by 字段名字 desc /asc select * from products order by price desc;//按照降序排列 limit select * from products order by price limit 1;//取出价格便宜的商品 select…
--将更新条件保存到临时表里 CREATE TABLE tmp3 AS (SELECT username FROM oa_user WHERE username NOT IN (SELECT username FROM nst_t_account)); --更新表数据,条件从临时表里取 UPDATE oa_user SET usr_update=NOW() WHERE username IN (SELECT username FROM tmp3); --删除临时表 DROP TABLE tmp3…