mlw <markw@mohawksoft.com> writes:
> If I do:
> create temp table fubar as select ftss_results() as songid;
> select * from cdsongs where songid = fubar.songid;
> That works, but that is slow and a lot of people have emotional difficulties
> with using temporary tables.
If you don't like temp tables, try
select cdsongs.* from cdsongs, (select ftss_results() as ftss) as tmp
where songid = tmp.ftss;
which'll produce the same results.
Do I need to point out that the semantics aren't the same as with IN?
(Unless the output of ftss_results is guaranteed unique...)
> Also, an 'IN' clause does not
> preserve the order of the results, where as a join should.
This statement is flat-out wrong --- don't you know that SQL makes no
promises about tuple ordering?
regards, tom lane