medev21 medev21 - 1 month ago 5
SQL Question

get output from two tables(table A and b) if column A from table A is equal to column B from Table B

So I have two tables A and B, both tables have a column address. Table A has id1 column and Table B has id2 column. I would like to get the address column (it can be table B) if the values in id1 and id2 columns are the same. How can I do that in sql command? It's worth to mention if these columns are the same, the addresses will be the same too or similar, so the address can be from either table. I'm very new to sql and your help will be much appreciated. Thanks in advance

Answer

You should try this: Select address from tablea as a, table b as b where b.id =a.id