msagala msagala - 14 days ago 5
SQL Question

Join 2 Table in postgresql but the other table only will extract its columns

Is there a way in postgres when you

join
2 Table but you only extract the columns of the first table using '*' symbol which means all of the columns of the first table.

Answer

I will answer this one because I solved it by the help of Mr.@Gordon Linoff.

I use the alias of the table and use it in the * symbol.

sample code below:

SELECT a.* FROM table_a as a join table_b as b ON a.id=b.id;

This will only extract the data of table_a.