Mysql - 有没有更好的方法从两个具有相同ID的表中检索数据?

时间:2012-06-05 15:27:01

标签: mysql select join

您好我有以下可用的Mysql代码,但我想知道是否有更好,更短,更有效的方法吗?

select
images.*,
posts.*
from
mjbox_images AS images,
mjbox_posts AS posts
where
images.post_id = 3 AND posts.post_id = 3

1 个答案:

答案 0 :(得分:3)

SELECT * FROM mjbox_images JOIN mjbox_posts USING (post_id) WHERE post_id = 3