![]() |
INNER JOIN query
Hi folks
Apologies in advance if this has been covered - I couldn't find the answer having done a bit of searching... I run vBadvanced and I want to produce a thank you box on the front page which shows the latest 10 positive reputation comments. The idea is to promote the reputation system and give people added incentive to give and receive rep points The information I want is in the reputation and user table. I want to get the following fields: reputation.postid reputation.userid reputation.whoadded reputation.reason user.username I've got this working with the following query: Code:
SELECT I'd be very grateful of any advice. I'm not feeling well today, and my brain hurts :) Thanks in advance... |
Quote:
[SQL]INNER JOIN user userwho ON userwho.userid = reputation.whoadded[/SQL] And in your select, you'd reference it by userwho.username |
It's good practice to use 'AS' (INNER JOIN user AS userwho .....). :)
|
Quote:
|
Ok folks - thanks for that. I'll give it a go and report back
Thank you --------------- Added at 12:12 --------------- Thanks chaps - that gave me what I needed. The resultant query looks like this: Code:
SELECT |
All times are GMT. The time now is 05:29 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|