Visualizzazione dei risultati da 1 a 2 su 2

Discussione: update di x record

  1. #1

    update di x record

    Ciao,
    devo modificare un campo di una tabella prendendo dei valori da un'altra.

    La relazione è così:

    table1 1<-R->1 table2 1<-R->1 table3

    Ho scritto questa query:

    update table1
    set zoneid = TmpTable.zoneid
    FROM
    (SELECT table1.SID, table3.zoneid
    FROM table1

    INNER JOIN table2
    ON table1.SID = table2.SID

    INNER JOIN table3
    ON table3.UserID = table2.UserID) AS TmpTable

    WHERE table1.sid = TmpTable.sid

    Eseguendo la query sqlserver mi restituisce il seguente errore:
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
    The statement has been terminated.

    Qualche suggerimento?
    Grazie.

  2. #2
    guarda QUA verso il fondo pagina.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.