Returning default values in SQL queries

294 Views Asked by At

I have a query in SQL where I select a couple of attributes from a few tables. However, I also need to return default hardcoded values such as 'HardCodeValue' in the results. I am not querying a table/column however for this but I do want a column in the results set called 'hardCodeDefaultValueColumn' with this hardcoded default value for every row in th result set.

Is there any way I can do this in SQL?

Thanks

1

There are 1 best solutions below

0
rikyeah On BEST ANSWER

Just add 'HardCodeValue' as hardCodeDefaultValueColumn in your SELECT, among the other columns selected, like so:

SELECT ..., ..., 'HardCodeValue' as hardCodeDefaultValueColumn
FROM ...