I've got 2 tables. 1 is a user table the other is their trade ratings. just like on ebay: ex someuser(500)
trade ratings are expressed only as -1,0,1.
When querying the user DB I want to join their rating SUM onto some user table column (say u_rating) so that i don't have to have to seperate queries.
my ratings table looks something like this, where r_uid is the user id from the users table...
CREATE TABLE ratings (
r_id INTEGER UNSIGNED AUTO_INCREMENT,
r_tid INTEGER UNSIGNED DEFAULT 0,
r_uid INTEGER UNSIGNED,
r_rating ENUM('-1','0','1'),
r_comment VARCHAR(250),
r_response VARCHAR(250),
My user table looks something like...
CREATE TABLE users (
u_id INTEGER UNSIGNED AUTO_INCREMENT,
u_type VARCHAR(30) DEFAULT 'Regular',
u_email VARCHAR(255),
u_username VARCHAR(30),
Thanks for your help guys!
Luc L.
trade ratings are expressed only as -1,0,1.
When querying the user DB I want to join their rating SUM onto some user table column (say u_rating) so that i don't have to have to seperate queries.
my ratings table looks something like this, where r_uid is the user id from the users table...
CREATE TABLE ratings (
r_id INTEGER UNSIGNED AUTO_INCREMENT,
r_tid INTEGER UNSIGNED DEFAULT 0,
r_uid INTEGER UNSIGNED,
r_rating ENUM('-1','0','1'),
r_comment VARCHAR(250),
r_response VARCHAR(250),
My user table looks something like...
CREATE TABLE users (
u_id INTEGER UNSIGNED AUTO_INCREMENT,
u_type VARCHAR(30) DEFAULT 'Regular',
u_email VARCHAR(255),
u_username VARCHAR(30),
Thanks for your help guys!
Luc L.