Subject RE: [firebird-support] Is this legal SQL?
Author Helen Borrie
At 09:06 AM 26/01/2004 +0100, you wrote:
>Thx for your reply Helen!
>But I don't think the offered solution will do the trick... I'll
>elaborate a bit just in case you (or others) have a bit more time to
>spare (I probably should buy myself a sql book).
>Lets say I have:
>***select 1 from table1 where col1 = 'aValue' and col2 = 'bValue'
>Both col1 and col2 belong to table1.
>But then I decide that col1 can be any value in an array, and this array
>is built from a subquery. Then I get:
>select 1 from table1 where col1 in < subquery > and col2 = 'bValue'
>It's this construct I'm wondering about. Both col1 and col2 still belong
>to table1. The way I read your solution col2 (i.e. HISTORIE) belongs to
>the subquery table (TABLE).

I read it that way because you wrote it that way.
How about you rephrase the original requirement and make it clear which
fields belong to which tables? In other words, use simple fieldnames like
col1, etc., and qualify them with their table names.

I'm constantly amazed at how confused people get about their SQL for no
more obvious reason than they will do ANYTHING to avoid a line-feed and a
space-character! ;-\