"Hello User Name" 1

“Hello User Name”

SELECT concat('Hello, ', firstname, ' ', lastname, '!') 
FROM users;

Here is what the above code is Doing:
1. We’re selecting the firstname and lastname columns from the users table.
2. We’re concatenating the string ‘Hello, ‘ with the firstname and lastname columns.
3. We’re concatenating the string ‘!’ to the end of the firstname and lastname columns.

The result of the above query is a column of strings that look like this:

Hello, Jane Doe!
Hello, John Smith!
Hello, Bob Jones!

Similar Posts