| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
select values from the 2 different tableSample tables (company_id RK companies.id):
Code:
Companies
id company
1 …
2 …
3 …
Locations
id company_id location revision
1 1 … 1
2 2 … 1
3 1 … 2
4 1 … 3
5 2 … 2
6 1 … 4
I try Select distinct companies.company, locations.location from Companies, Locations where companies.id=Locations.company_id ... How? thanks. |
|
|||
SELECT Companies.id, Locations.location, revision I do this...it works, but if i just want to output the first 2 column, how? Companies.id, Locations.location only..i only can do if revision is output together with it,. Please help. thanks. |
|
|||
SELECTTotally not tested. Yet, I hope it is of any help. Dimitar |