![]() |
| ||
| Query Help Problem: I have two tables and those two table have one field in common which is "S_ID" first table have 2 fields: "S_ID", "T_ID" second table have these fields: "S_ID", "First", "Last" ---------------------------------- What i want to do is that i need to extract the the field "S_ID" from the first table and order them by the field "Last" which is in the other table. any one know how i can do that in one or 2 query. Also I am using php. |
| ||
| Re: Query Help Quote:
select ft.s_id |
| ||
| Re: Query Help Thanks A lot. That worked really nice. I never really understood JOIN commands, even if i read the books for SQL they only comfused me more LOL. |
| ||
| Re: Query Help Quote:
A join basically combines records from more than one table. This article may help but the best way to understand is to make some test tables and actually have a go at constructing queries that utilise different types of joins. |
| ||
| Re: Query Help SELECT * FROM first, second WHERE first.S_ID=second.S_ID ORDER BY second.Last Does the same thing, but is much faster than a join. |
| ||
| Re: Query Help Thanks I will try that too. |
| All times are GMT -4. The time now is 8:35 am. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC