0

私のテーブルの構造:

posts (id, name, user_id, about, time)    
comments (id, post_id, user_id, text, time)
users_votes (id, user, post_id, time)
users_favs ( id, user_id, post_id, time)

これらの 4 つのクエリを組み合わせるにはどうすればよいですか ( を使用しないでくださいUNION)。

SELECT `id`, `name`, `user_id`, `time` FROM `posts` WHERE `user_id` = 1
SELECT `post_id`, `user_id`, `text`, `time` FROM `comments` WHERE `user_id` = 1
SELECT `user`, `post_id`, `time` FROM `users_votes` WHERE `user` = 1
SELECT `user_id`, `post_id`, `time` FROM `users_favs` WHERE `user_id` = 1

sを使用する必要がありますJOINか?

これに対する SQL クエリは何でしょうか?

4

1 に答える 1