I have read the MySQL manual on joins which wasn’t much help. I also read this (http://www.devshed.com/Server_Side/MySQL/Join/page1.html) online tutorial which was a little help. I haven’t chatted with people on an IRC channel. But I still can’t seem to make my join statement work.
Here is the scenario… I have two tables. Both tables have a state column. I would like to join the two tables and then select the distinct states from the two tables that are joined. Sounds simple right? Not so for me today! My two tables are clubs and pc_profiles. The name of the column I’m selecting is state. Also, after I get that figured out I really need to only select records from the clubs table where the hidden column is not equal to 1.
Here is what I have tried so far.
SELECT DISTINCT t1.state FROM pc_profiles t1 LEFT JOIN clubs USING (state) ORDER BY state;
SELECT DISTINCT state FROM clubs, pc_profiles;
And the list goes on…