MichaelRSnow
Active Member
- Joined
- Aug 3, 2010
- Messages
- 409
I’m new SQL, trying to teach myself but need some help
I have this code (above) thatreturns a Product ID number, can I run a query off this result (within the samequery) to return another value linked to that ID within the database i.e.
I have this code (below) whichreturns a value for ‘Current Product ID’, which I would like to re-run withinthe same query on the result of the ReplacedProductID to return the Rate % forthis replaced ID?
Can yourun a SQL Query on a result within a SQL query?
Code:
--PREVIOUS Product ID
, ISNULL(CONVERT(char, ReplacedProductID), '') AS 'Previous Product ID'
I have this code (above) thatreturns a Product ID number, can I run a query off this result (within the samequery) to return another value linked to that ID within the database i.e.
I have this code (below) whichreturns a value for ‘Current Product ID’, which I would like to re-run withinthe same query on the result of the ReplacedProductID to return the Rate % forthis replaced ID?
Code:
-- RATE
, ISNULL(CONVERT(char, RatePercentage), '') AS 'Rate'
Can yourun a SQL Query on a result within a SQL query?
Last edited by a moderator: