database - Include table name in column from select wildcard sql -


is possible include table name in returned column if use wildcard select columns tables?

to explain further. suppose want join 2 tables , both tables have column name “name” , many other columns. want use wildcard select columns , not explicitly specifying each column name in select.

select *  tablea a, tableb b  a.id = b.id 

instead of seeing 2 column same name "name", write sql return 1 column name "a.name" (or tablea.name) , 1 "b.name"(or tableb.name) without explicitly putting column name in select?

i prefer solution mssql other database reference too.

thanks!

you joining 2 tables on id field, see 1 column labeled "id", not two, because asking see records id same in table , table b: share same id.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -