0

I would like to get row from Postgres database. This row in db have to parameters(column): firstname and lastname.

Regular Select query would download theme as separate fields. but I would like to concatenate them with dot between them.

I would like to get from row:

firstname lastname

one value as follow: firstname.lastname

Currently I do something like this:

SELECT (firstname, lastname) AS user FROM users

But In result I am getting:

(firstname,lastname)

Can You help?

1 Answer 1

1

Use the following

SELECT (firstname::text || '.'::text || lastname::text) AS user FROM users
Sign up to request clarification or add additional context in comments.

2 Comments

It worked. Thanks. Can You tell me how to make result lowercase?
lower(firstname::text || '.'::text || lastname::text)

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.