In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Trond Erling Hundal") wrote:

> I want to query two tables in my db. One containing a list of numbers
> ranging from 10000 - 10200, the other table is storing information that is
> relative to some of the numbers:
> 
> Eks:
> Table1.record1:  number=10000
> 
> Table2.record1:  number=10000 name=John
> 
> Now I want to query these to tables to show a table that has one column with
> the numbers, and if there is a name stored in the other table for this
> number, I want to display this.

Try:

select table1.number as num, name FROM table1
left join table2 using (number)

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to