On Fri, 10 Aug 2001 pgsql-general@commandprompt.com wrote:
>On Fri, 10 Aug 2001, Jeremy Hansen wrote:
>>select * from env_info,summary,plat_info;
>>Is my statement broken? Is this not legal? Postgres just sits there....
>Well, without a JOIN or a WHERE clause, this query is going to try create
>the raw cartesian product of the two tables.
Er, thought that was a dot. Make that three tables, even worse if these
are even large-ish tables.
I have no idea what your table structure is like, but assuming there is
some sort of relation between these tables, you'd really want to do
something like:
SELECT * FROM env_info INNER JOIN summary
ON (env_info.id=summary.id) INNER JOIN plat_info
ON (env_info.id=plat_info.id);
If there's no relationship between these tables, alternatively, I'm not
sure what you're trying to accomplish. ;)
Regards,
Jw.
--
jlx@commandprompt.com by way of pgsql-general@commandprompt.com