M
M
Max Trophy2016-05-24 21:54:58
SQL Server
Max Trophy, 2016-05-24 21:54:58

MS SQL: How to display table name in SELECT query?

In the command , the SELECT * FROM tableresult will be the entire table, but without a title. How to make it so that there is a name?
Tried

SELECT Product AS N'товары'
FROM Mytable AS N'таблица товаров'

..but swears at the syntax in line 2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2016-05-25
@kapitoly

SELECT 1, 'таблица товаров'
UNION
SELECT 2, Product AS 'товары' FROM Mytable
ORDER BY 1, 2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question