Hello,
Here's one for all you SQL wizards out there:
OK, I have 2 tables, one holds descriptions of products, and the other holds user ratings for those products (2 tables are linked by ID), e.g.
table 1: descriptions
id | name
------------------
1 | Test product1
2 | Test product2
table 2: user ratings
prodid | rating | comments
------------------------------------
1 | 1 | This product sucks
2 | 4 | Quite good
1 | 3 | Average I suppose
My question is this, if I get the average user rating for, say, product 1 (select avg(rating) from ratings where prodid=1), how can I then compare this with the other products. In other words, I want to select all the entries from description where the average user rating is higher.
Can anyone help? C:\DOS:>
C:\DOS:>RUN
RUN DOS RUN!!
Here's one for all you SQL wizards out there:
OK, I have 2 tables, one holds descriptions of products, and the other holds user ratings for those products (2 tables are linked by ID), e.g.
table 1: descriptions
id | name
------------------
1 | Test product1
2 | Test product2
table 2: user ratings
prodid | rating | comments
------------------------------------
1 | 1 | This product sucks
2 | 4 | Quite good
1 | 3 | Average I suppose
My question is this, if I get the average user rating for, say, product 1 (select avg(rating) from ratings where prodid=1), how can I then compare this with the other products. In other words, I want to select all the entries from description where the average user rating is higher.
Can anyone help? C:\DOS:>
C:\DOS:>RUN
RUN DOS RUN!!