
3 Tables in 1 Query
December 19, 2007You can get data from 3 tables at the same time all in 1 query.
SELECT DISTINCT a.f_user_id, c.f_username, a.f_raffle_number
FROM t_model_raffle a
INNER JOIN t_buy_transaction b
ON b.f_user_id = a.f_user_id
INNER JOIN t_user_profile c
ON c.f_user_id = a.f_user_id
WHERE b.f_status = 'Completed';