dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 192 forks source link

Display table name/alias in columns with the same name when displaying results of join queries. #527

Open Astroxslurg opened 2 years ago

Astroxslurg commented 2 years ago

When I join multiple tables I cannot distinguish between columns with the same name in output. E.g. if i join 3 tables together and every table has an "id"-column each of the columns has the same name making it very hard to tell which of the columns belong to which table.

Is there a way to make mssql-cli display table names or aliases in these results?

chrisg123 commented 2 years ago

Off the top of my head could you not just "AS" the fields ? (table1.id AS table1_id table2.id AS table2_id...etc)