摘要:
select count(*) from <>表名 例 select count(*) from user_info 阅读全文
posted @ 2022-07-26 15:24
最帅爸爸
阅读(1524)
评论(0)
推荐(0)
摘要:
select * from <表名> group by<过滤的数据> having <晒选的列名>=<条件> 例 select * from villa_info group by villa_id having villa_state='待激活 select * from villa_info w 阅读全文
posted @ 2022-07-26 15:22
最帅爸爸
阅读(200)
评论(0)
推荐(0)
摘要:
select * from <表名> order by <列名> desc limit <第几位数>; select * from villa_info order by villa_id DESC limit 1; --拿到表villa_info中最后一个的villa_id -- asc升序拿到第 阅读全文
posted @ 2022-07-26 15:16
最帅爸爸
阅读(54)
评论(0)
推荐(0)
摘要:
update <表名> ser <更换的列名> replace(<更换的列名>,'<更换前的对象>','<更换后的对象>') 例 update `villa_info` set villa_details = REPLACE(villa_details, '\n', ''); --将villa_in 阅读全文
posted @ 2022-07-26 15:14
最帅爸爸
阅读(184)
评论(0)
推荐(0)
摘要:
select <查询的列名或者 *(全部)> from <表名> where 条件=(里面在放一条查询的语句查询你所需要的条件) --逻辑合理,可以一直嵌套下去,每次查出来的数据当作下一次的查询条件 例 select * from order_item where oitem_id=(select 阅读全文
posted @ 2022-07-26 15:09
最帅爸爸
阅读(341)
评论(0)
推荐(0)
摘要:
select <查询的列名> from <表名> inner join `<连接的表名称>` on <第一张表的主键> = <第二张表的外键> --没有先后顺序,下面依次类推,就接着inner join --条件判断用where 例 select facilities.facilities_name 阅读全文
posted @ 2022-07-26 15:00
最帅爸爸
阅读(138)
评论(0)
推荐(0)
摘要:
select <查询的字段,用逗号隔开> --如果两张表中有相同的字段,但是你要查其中一张表的相同字段,要声明出哪张表的字段,如:select `villa_info`.villa_id,查询villa_info里的villa_id from <表名> --多张表就写多个表名,用逗号隔开 where 阅读全文
posted @ 2022-07-26 14:55
最帅爸爸
阅读(95)
评论(0)
推荐(0)
浙公网安备 33010602011771号