0

Is it possible to add a dummy row in the select clause which represents as a header to the results that are returned. The header should be part of the SQL query results.

Name|Address|Phone Numer
XYZ|City name|1233457890

The second row is the sql result and first one the header. I already have the header string constructed which is dynamic.

2
  • maybe with UNION Commented Sep 24, 2019 at 22:53
  • You could do something like this but note that it will attempt to cast all the data in the rest of your query to the types of the values in the header. Commented Sep 24, 2019 at 23:07

1 Answer 1

1

Here's your query.

select 'Name' as "Name", 'Address' as "Address", 'Phone Number' as "Phone Number" from dual
union all
select Name, Address, "Phone Number" from yourtable
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.