Answers for "sql show wanted columns in a join table"

SQL
1

sql inner join sprcific columns

SELECT
    t1.* -- All columns from table1
    ,
    t2.columnName -- Just that column from table2
    ,
    t3.columnName -- And just that column from table3

FROM
    table1 AS t1

    INNER JOIN table2 as t2
        ON t1.id = t2.table1_id

    INNER JOIN table3 AS t3
        ON t1.id = t3.table1_id
Posted by: Guest on July-02-2020
0

insert to first table if field A equals field B from a second table using sql

UPDATE Table_1 SET Field_X = (SELECT Field_Y FROM Table_2 WHERE Table_1.Field_A=Table_2.Field_B LIMIT 1)
Posted by: Guest on June-23-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language