D
D
danielsadovskiy2018-11-07 21:49:57
SQL
danielsadovskiy, 2018-11-07 21:49:57

SQL query for everyone - everything?

TABLE sport(Name TEXT, Surname TEXT, Num TEXT, Vid TEXT, Mark REAL, Shtraf REAL) First name, last name, number, sport, points, penalties. How for each pair of first name, last name to display all sports where he took part?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Game Master, 2018-11-07
@baitarakhov

Basically, this is solved by one of the two group functions below, depending on which DBMS you are working on. The methods of use are detailed in the documentation and on the Internet, including in Russian.
T-SQL: string_agg function
https://docs.microsoft.com/en-us/sql/t-sql/functio...
PL/SQL: listagg function
https://docs.oracle.com/cd/E11882_01/ server.112/e4... Of
course, you can invent your own bike, but why?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question