如何高效查询表的总记录数
答案:1 悬赏:20 手机版
解决时间 2021-03-18 18:50
- 提问者网友:孤凫
- 2021-03-18 10:32
如何高效查询表的总记录数
最佳答案
- 五星知识达人网友:想偏头吻你
- 2021-03-18 12:08
有2个方法:
1、select *,(select count(u_id) from h_travel_line where u_id = a.u_id) 已线路数
from h_travel a
2、SELECt c.ttt AS 已线路数, h_travel.*
FROM h_travel INNER JOIN
(SELECt COUNT(*) AS ttt, u_id
FROM h_travel_line
GROUP BY STID) c
ON h_travel.u_id =c.u_id
1、select *,(select count(u_id) from h_travel_line where u_id = a.u_id) 已线路数
from h_travel a
2、SELECt c.ttt AS 已线路数, h_travel.*
FROM h_travel INNER JOIN
(SELECt COUNT(*) AS ttt, u_id
FROM h_travel_line
GROUP BY STID) c
ON h_travel.u_id =c.u_id
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯