Y
Y
YakovSpb2020-06-14 12:40:40
SQL
YakovSpb, 2020-06-14 12:40:40

How to compose a query in SQl as a string?

How to write a query that will return the result in the form of a table (not a row!) Of 12 rows, each row has 2 columns, in one column the month of the current year, in the other - the number of days in the month. In the query, do not use existing tables from the database, including temporary ones, i.e. query should work immediately from any SQL console?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman, 2020-06-14
SQL

SELECT 'Январь', 31
UNION
SELECT 'Февраль', 29
....

take leap years into account

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question