Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Posts
    20

    Unanswered: Update Table A w/Value from TableB

    I have noticed some examples that answer part of my question but I don't think the examples gave me the entire answer I need.

    I need to update serveral rows in TableA with values from TableB.

    Here is my SELECT statement for the value I need from TableB:

    Code:
    SELECT 	a.Factor 
    FROM 	Factors a,
    	   Information b,
    	   Data c
    WHERE c.CID = @CID
    AND	b.QID = c.QID
    AND 	a.QTypeID = b.QTypeID
    AND	a.GID = 1
    AND 	a.TID = 1
    AND 	a.AID = 
    (
    	SELECT	AID
    	FROM 	Ranges
    	WHERE 	RangeLower < @Value
    	AND 	RangeUpper > @Value
    )
    Here is my UPDATE Statement:

    Code:
    UPDATE Data 
    SET Factor = FactorFromSelectStatementAbove
    WHERE CID = @CID
    Any help would be GREATLY appreciated.

    Piet

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Post the DDL, sample Data, and the expected result

    provide sample data in the form of DML statements
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2002
    Posts
    20
    Brett,

    Two quick questions before I provide you with the data.

    1. Is there an easy way to create the DDL's and DML's?
    2. Should I ever be concerned with posting my DB data?

    Thanks,

    Piet
    Last edited by piet; 10-22-04 at 18:57.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •