SQL Query returning more than one value

Posted on 2011-05-02
Last Modified: 2012-05-11
I need help with an update similar to something like this (I am totally oversimplifying but I think it explains my problem):

Table #1
Number    Data

Table #2
Number   Data
1             Stuff
2             Different Stuff
3             Something Different

I want to populate the first table with the data from the second table but when I do an update something like

Update Table#1
set = (select from table#2)
where ......

I get the error returning more then one value.  I understand why it doesn't work, but does anyone have any suggestions?

Thank you
Question by:MercyHousing
    LVL 32

    Expert Comment


    Update Table#1
    set = (select from table#2 where Table#1.Number=Table#2.Number)
    LVL 33

    Accepted Solution

    update table1
    set data =
    from table1 T1
    join table2 T2
      on T1.Number = T2.Number

    Author Closing Comment

    Thank you, that did it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
    How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now