Users
id, first, last
1 John Johnsson
2 Mark Jackson
3 Chris Lager
Tags
id, userID, tag, pass, active
1 2 42564eb6 <some hash> 1
2 1 524846b6 <some hash> 0
What i want to output is this combination of data:
Tags
ID(from user), First name, Last name, Tag number, Password hash, Active
1 John Johnsson 524846b6 <hash> 0
2 Mark Jackson 42564eb6 <hash> 1
3 Chris Lager
So basically, I want a table with users, ordered by their ID’s, with the tag number, pass and active fields if applicable
I’m using webbased databases with PHPMyAdmin on an external server, and I am querying on it in Java through JDBC.
My question: what query do I need to use for this? I’m not really sure what commands such as Group By or Order By will do with my data, which comes in as a ResultSet object in Java.
I think it’s a LEFT JOIN, eg: