Sql select all for only one table

I have a couple that I make. I say tablename.column to determine what I want to select in the database ... I don't want to select all columns. However, my last connection I want to choose for this. Is there a way I can use an asterisk or something for the last connection?

The last table will be dynamic, so I can’t write it hard (although I could write it dynamically), but I thought it might be easier.

SELECT content_name.name, house.listing, street.* FROM content INNER JOIN house ON content_name.id=house.id LEFT JOIN street ON content_name.id=street.id; 
+6
sql php postgresql
source share
1 answer

The alias of your last table is the same every time, and then simple. * your nickname.

 SELECT content_name.name,house.listing, last_table.* FROM content INNER JOIN house ON content_name.id=house.id LEFT JOIN street last_table ON content_name.id=last_table.id; 

As the saying goes, * in a manufacturing request is an accident expected.

+7
source share

All Articles