例如有表:
create table user(
uid integer(10),
user_name varchar(20)
);
create table action(
uid integer(10),
action_name varchar(20)
);
action表中的uid作为user表中的外键去用。
如何联合查询效率比较高?
例如
select count(*) from user,action where user.uid = action.uid;
select count(*) from user as u left join action a on u.uid = a.uid;
哪种效率会高一些??
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
走同样的路,发现不同的人生