Insert using LEFT JOIN and INNER JOIN

后端 未结 3 1076
南旧
南旧 2020-12-07 19:02

Hey all i am trying to figure out how to go about inserting a new record using the following query:

SELECT user.id, user.name, user.username, user.email, 
           


        
3条回答
  •  感动是毒
    2020-12-07 19:25

    INSERT INTO Test([col1],[col2]) (
        SELECT 
            a.Name AS [col1],
            b.sub AS [col2] 
        FROM IdTable b 
        INNER JOIN Nametable a ON b.no = a.no
    )
    

提交回复
热议问题