0
Good morning,
I have a database here with the tables below, and I wanted to generate a table with the combination of the registered teams
Time ------ Time A Time B Time C Time D
The final table would look like this:
TABELA 1 | TABELA 2 TIME A | TIME B TIME B | TIME C TIME C | TIME D TIME A | TIME C TIME D | TIME A
The command I tested was this:
SELECT a1.nome_time, a2.nome_time
FROM times a1, times a2
WHERE a1.nome_time < a2.nome_time;
how could you modify this command so that the table does not repeat in the second column?
Review your final table and check if this is the desired result.
– anonimo
What you could do would be a for in an outside language, to be able to pick a number and assign to the ID of this team and this number was not repeated
– DbaAlone