> try...

> SELECT c.id, c.description
> FROM
>       choicetable c
> WHERE
>       c.productid = '#URL.productid#'
>       AND c.id NOT IN (
>       SELECT
>               pc.choiceid
>       FROM
>               productchoicetable pc
>       WHERE
>               pc.productid = '#URL.productid#'
>       )

or use not exists

SELECT c.id, c.description FROM choicetable c
WHERE NOT EXISTS (
        SELECT pc.productid FROM productChoiceTable
        WHERE pc.productid = #url.productid#
)

Might be faster -- not sure... You'd have to either compare the plans for
the two queries in enterprise manager or just run them several times and
compare the execution times...

This assumes you're using SQL Server


Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to