Re: SELECT query from two tables

From: Date: Sun, 09 Mar 2008 23:37:18 +0000
Subject: Re: SELECT query from two tables
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-44732@lists.php.net to get a copy of this message
ministry_directory_listing_categories.ministry_directory_category_reference = 10 AND ministry_directory_listing_categories.ministry_directory_category_reference = 11
Can a record really have a reference for two different id's like this? ie can it be both '10' and '11' at the same time? What's actually in the table for ministry_directory_listing_categories for this record? For long table names, I'd also suggest using a table alias to make it easier to read/write: select * from table1 as a inner join table2 as b using(id) where a.field_name='1' and b.fieldname='5'; saves you having to write out 'ministry_directory_listing_categories' and 'ministry_directory'. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#44732) next »