Knowee
Questions
Features
Study Tools

Write a query to display all the owner_name and concatenate contact_number and email with a hyphen(-) separated . Display the records in descending order based on owner_name . Give an alias name as 'contact_details'.

Question

Write a query to display all the owner_name and concatenate contact_number and email with a hyphen(-) separated . Display the records in descending order based on owner_name . Give an alias name as 'contact_details'.

🧐 Not the exact question you are looking for?Go ask a question

Solution

Assuming you are using SQL, the query would look something like this:

SELECT owner_name, CONCAT(contact_number, '-', email) AS contact_details
FROM your_table_name
ORDER BY owner_name DESC;

Please replace your_table_name with the actual name of your table. This query will select the owner_name and concatenate contact_number and email with a hyphen in between. The AS keyword is used to assign an alias contact_details to the concatenated field. The ORDER BY clause is used to sort the records in descending order based on owner_name.

This problem has been solved

Similar Questions

Write a query to display the owner_name and mail id in which the string should end before the '@' symbol. Display the details of the buildings which are having the  email address and give an alias name as 'email_name' and display it in ascending order based on owner name

Write a query to display the owner_name and contact_number of all building, Display the records in ascending order based on owner_name.

Write a query to display the first 3 characters of the owner_name and the contact_number of all buildings in ascending order based on the owner name of the building. Give an alias to the first 3 characters as 'name_code'.

Write a query to display the entire details of the 'building' whose owner_name starts with the letter 'M', Display the records in ascending order based on their owner_name.

QueryQ14Write a query to display the owner_name, address and contact_number of the buildings which does not have an email_address. Display the records in ascending order based on their owner_name.

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.