>>SELECT d.document_id
>>FROM document d, courier_info ci
>>WHERE d.document_id = ci.doc_inv_id
>>AND d.document_id IN (SELECT UNIQUE doc_inv_id FROM courier_info
>> WHERE fielda = '10' and fieldb = 'a')
>>ORDER BY ci.order_field
> That cannot work since the join is made on the non unique table.
Of course! You are right.
Didn't think long enough before posting :)
> Another and IMHO more elegant solution: inline view:
>
[quoted text clipped - 3 lines]
> WHERE d.document_id = ci.doc_inv_id
> ORDER BY ci.order_field
I was thinking of the inline view as well, but I'm not sure if Informix supports
that...
Regards
Thomas
Robert Klemme - 19 May 2004 15:29 GMT
> >>SELECT d.document_id
> >>FROM document d, courier_info ci
[quoted text clipped - 7 lines]
> Of course! You are right.
> Didn't think long enough before posting :)
Such things happen. No need to worry.
> > Another and IMHO more elegant solution: inline view:
> >
[quoted text clipped - 6 lines]
> I was thinking of the inline view as well, but I'm not sure if Informix supports
> that...
If not, Clive can create a real view instead.
Kind regards
robert