0

I want to select city_id and customer_address from customer table but I also want to add an extra column which inludes only "customer" word to indicate the result derived from customer table.

Desired Output:

Table       ID  Address
customer    12  Address 1
customer    32  Address 2
customer    212 Address 3
customer    2   Address 4
customer    32  Address 5
customer    212 Address 6
customer    21  Address 7
customer    21  Address 8

Statement something below would be great:

SELECT ADDCOLUMN("customer"), city_id, customer_address FROM customer;

customer table schema is below:

enter image description here

Shadow
  • 33,525
  • 10
  • 51
  • 64
mcan
  • 1,914
  • 3
  • 32
  • 53

1 Answers1

1

In T-SQL SELECT [table] = 'customer', city_id, customer_address FROM customer; works, as does SELECT 'customer' AS [table], city_id, customer_address FROM customer;.

knot22
  • 2,648
  • 5
  • 31
  • 51