Simply select char, or string
What is the way to achieve expected result from psql select:
SELECT 'Hello world';
using this in SQuirreL I get value: in unnamed column. What is the way to get string Hello world as a result?
I want to use this approach to format outputs using commas, colons, etc. Is there another way to pre-prepare results for further usage?
Thanks in advance for any help
I want get one column with 'Hello word' as its content. Column name is unset here (in squirrel '?column?')
It's because you didn't give that column a name (alias)
If you'll do it like this
SELECT 'Hello world' AS column_name
| COLUMN_NAME | |-------------| | Hello world |
Here is SQLFiddle demo
This is an old question, but I ran into the same problem with SQuirreL, and found a simple work-around. Try this in SQuirreL:
SELECT trim('Hello world') AS column_name;
Actually, any of the PostgreSQL string functions will work, like upper(), lower(), etc., depending on your needs.
The question is not clear but I give you the possible optionsin one block
begin declare @PreDefinedVariable nvarchar(50) Select @PreDefinedVariable = 'Hello World!' select @PreDefinedVariable as [Result] end
It is an SQuirreL SQL Client issue, using psql from bash I get expected:
tdb14=> SELECT 'Hello world' AS column_name; column_name ------------- Hello world (1 row)