Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to label result tables in multiple SELECT output

I wrote a simple dummy procedure to check the data that saved in the database. When I run my procedure it output the data as below.

enter image description here

I want to label the tables. Then even a QA person can identify the data which gives as the result. How can I do it?

**Update : ** This procedure is running manually through Management Studios. Nothing to do with my application. Because all I want to check is whether the data has inserted/updated properly.

For better clarity, I want to show the table names above the table as a label.

like image 874
Jude Niroshan Avatar asked Dec 18 '22 17:12

Jude Niroshan


1 Answers

Add another column to the table, and name it so it will be distinguished by who reads them :)

 Select 'Employee' as TABLE_NAME, * from Employee

Output will look like this:

| TABLE_NAME | ID | Number | ...
------------------------------
| Employee   | 1  | 123    | ...

Or you can call the column 'Employee'

SELECT 'Employee' AS 'Employee', * FROM employee

The output will look like this:

| Employee | ID | Number | ...
------------------------------
| Employee | 1  | 123    | ...
like image 103
Mocas Avatar answered Dec 28 '22 10:12

Mocas