|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help With SQL
I have a table rating:
{user_id,film_id,rating} I need to select all the film_id and rating for user 2 but user 1 must have also rated the movie as well. The query is slow, whats the maxium i should use atm using a amd 64 3.2 with 2gb ram and its a inner table join on 2000000 rows. Its super slow. Any other way. Thanks in advance Ben |
|
#2
|
||||
|
||||
|
Code:
select distinct
r2.film_id
, r2.rating
from ratings as r1
inner
join ratings as r2
on r1.film_id
= r2.film_id
where r1.user_id = 1
and r2.user_id = 2
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Help With SQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|