gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 05:35:39 24 4
gpt4 key购买 nike

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

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

最佳答案

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

关于Mysql - 是否有更好的方法从具有相同 ID 的两个表中检索数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10900196/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com