List:General Discussion« Previous MessageNext Message »
From:Roger Baklund Date:August 19 2003 8:21pm
Subject:Re: Query question
View as plain text  
* Jack Lauman 
> I have two tables, contact_account and contact.
> 
> contact_account has two fields: contact_id (pk) and account_id
> 
> contact has a PK of contact_id
> 
> I to select all the columns in contact where account_id=13
> 
> I tried:
> 
> SELECT * FROM (contacts INNER JOIN account on contact.contact_id =
> account.account_id) WHERE account.account_id = 13;

SELECT * FROM contacts 
  INNER JOIN account ON 
    contact.contact_id = account.contact_id
  WHERE account.account_id = 13;

> One I get the query to work right I neet to write it to a file in CSV
> format.

See the SELECT ... INTO OUTFILE:

<URL: http://www.mysql.com/doc/en/SELECT.html >

-- 
Roger
Thread
Query questionJack Lauman19 Aug
  • Re: Query questionKeith C. Ivey19 Aug
  • Re: Query questionRoger Baklund19 Aug
  • Re: Query questionPatrick Shoaf19 Aug