Hey all,
Well I've run into a bit of trouble with SQL.
I have two tables as shown below:
CATEGORIES
id category
1 action
2 drama
3 comedy
MOVIES
id category movie
1 action Movie Name 1
2 action Movie Name 2
3 action Movie Name 3
4 action Movie Name 4
5 action Movie Name 5
6 action Movie Name 6
7 action Movie Name 7
8 action Movie Name 8
9 action Movie Name 9
10 action Movie Name 10
11 comedy Movie Name 11
12 drama Movie Name 12
13 drama Movie Name 13
etc etc etc
What I would like to do is select 6 movies from each category (There are a lot more rows in my database than that) but I want to do it in one SQL query.
Anyone have some idea how?
Thanks all,
Rhett.
Well I've run into a bit of trouble with SQL.
I have two tables as shown below:
CATEGORIES
id category
1 action
2 drama
3 comedy
MOVIES
id category movie
1 action Movie Name 1
2 action Movie Name 2
3 action Movie Name 3
4 action Movie Name 4
5 action Movie Name 5
6 action Movie Name 6
7 action Movie Name 7
8 action Movie Name 8
9 action Movie Name 9
10 action Movie Name 10
11 comedy Movie Name 11
12 drama Movie Name 12
13 drama Movie Name 13
etc etc etc
What I would like to do is select 6 movies from each category (There are a lot more rows in my database than that) but I want to do it in one SQL query.
Anyone have some idea how?
Thanks all,
Rhett.






