Answer the question
In order to leave comments, you need to log in
Is it possible to create such a SQL query?
Good afternoon!
tableA _
f1 | f2 | f3 | f4 | f5 |
---|---|---|---|---|
one | one | one | a | 3 |
one | one | one | b | one |
one | one | one | c | eleven |
one | 2 | one | e | 3 |
one | 2 | one | d | one |
one | 2 | one | c | fifteen |
f1 | f2 | f3 | f4 | f5 |
---|---|---|---|---|
one | one | one | c | eleven |
one | 2 | one | c | fifteen |
f1 | f2 | f3 | f4 | f5 |
---|---|---|---|---|
one | one | one | c | eleven |
f1 | f2 | f3 | f4 | f5 |
---|---|---|---|---|
one | one | one | c | eleven |
one | 2 | one | NULL | NULL |
Answer the question
In order to leave comments, you need to log in
User kuzemchik wrote correctly. But in my opinion the question is worded very strange. Why is query 1 given if it is not involved in the question? What does it mean to reformulate a request? It feels like "the only right decision" is being imposed. If the question is from the teacher, then here is the “rewording”:
select 1 As f1, 1 As f2, 1 As f3, 'c' As f4, '11' As f5
union
select 1 As f1, 2 As f2, 1 As f3, null As f4, null As f5
left join on itself with a where clause. The first three fields are from the first table, the last two are from the second
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question