you can't use SELECT * in a subquery.  ideally, it should return 1 value
(such as product_id or some such) to use in your where clause.  think of it
as a rvalue in a WHERE clause.

you're also missing a modifier (AND/OR) between your sub-selects.  ideally,
it should look something more like this:

SELECT * FROM product_update
        where <something, probably product_id> IN
        (SELECT <whatever you have a an lvalue in your outside where> FROM
product_update where produp_productname = '#product#' AND
produp_version >= '#ver#' AND produp_build > '#build#')


notice how i collapsed your subselect, since the only difference was > or =
produp_version.  my comments are in <>'s.


chris olive, cio
cresco technologies
[EMAIL PROTECTED]
http://www.crescotech.com



-----Original Message-----
From: Dan Sullivan [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 29, 2000 11:25 AM
To: CF-Talk
Subject: <CF_NESTED_QUERIES_HELP>


All,

I'm trying to get the correct syntax for a nested query but I keep
getting ODBC errors.  Below are the two select statements that
I am trying to combine together.  Any hints would be appreciated.

This code below obviously doesn't work, but the sub select statements
work.

SELECT * FROM product_update
        where IN
        (SELECT * FROM product_update where produp_productname = '#product#' AND
produp_version = '#ver#' AND produp_build > '#build#')
        (select * FROM product_update where produp_productname = '#product#' AND
produp_version > '#ver#')


D-
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server!      Instant Activation for $99/month w/Free 
Setup from SoloServer      PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support     
 Visit SoloServer, https://secure.irides.com/clientsetup.cfm.

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to