我有一个电影数据库,其中包含电影,演员和导演的表格。每部电影在电影表中占据一行。几乎我所有的查询都需要连接到其他表,以使LIMIT 9 C. }# l5 G" z3 A50(偏移量为0)的查询返回大约4部电影的完整数据。下面是一个示例查询。我如何修改此设置以确保获取恰好10部电影的数据? 1 P5 H8 K7 E$ FSELECT movie.id, movie.title, star.name, star.name_url, dir.name, 3 M) I! A3 c" N# h: N" u
dir.name_url, genre.name, genre.name_url + z/ |! B# i N( Q7 o6 t8 ~$ z
FROM movie ) y/ v+ S3 z6 R# }2 S
LEFT JOIN actor 9 B4 _) Y7 G. B0 ~8 b, I" a1 x ON (movie.id = actor.movie_id) " Z2 ~6 c6 U! p LEFT JOIN person AS star 8 |- C4 w4 E. }2 v3 o
ON (actor.person_id = star.id) ( t- ^; b4 L6 u1 U' d5 ], g
LEFT JOIN director 6 ?8 L/ X" K3 b# v/ ~
ON (movie.id = director.movie_id) ' L3 w( Z1 v9 P1 v. d& Y5 T8 h! |* t
LEFT JOIN person AS dir ! H: ]( c# V3 \9 h' }1 v
ON (director.person_id = dir.id) & i6 g5 n2 I. r6 b) T; U. T+ O LEFT JOIN genre_classification * j9 R, k b) j# l! A; t ON (movie.id = genre_classification.movie_id) ! r9 }- j5 X* N$ Y7 y8 Z, K
LEFT JOIN genre # u, R' {1 r/ q8 E
ON (genre_classification.genre_id = genre.id)2 F8 [8 E. i" z: f' \4 t
WHERE (movie.id > 0) . h8 }+ W7 I% _2 t) rORDER BY movie.id 3 E# t4 r- Z, t0 y
LIMIT 50 OFFSET 0; , V4 V+ x$ s* _ @ {$ e& x我正在使用PostgresSQL,可能没关系。# Z8 Q! Z! f4 U+ ^% ]! x5 B% R