第一种:select a.login_time,a.mode,a.mac,a.agent,s.shopname,ag.name from authlist a inner join shop s on a.shopid=s.id inner join agent ag on s.pid=ag.id order by a.login_time desc limit 0,30
第二种是单独查询三个表,在程序里面用foreach联合
哪种方法好呢?
kider 发表于 2015-3-18 16:49
应该是第二种要好,性能好。
如果数据量少用第一种方便。
欢迎光临 MySQL社区 (http://www.mysqlpub.com/) | Powered by Discuz! X3.2 |