Y
Y
ya_yshel_rabotati_v_teleg2020-01-25 19:37:58
MySQL
ya_yshel_rabotati_v_teleg, 2020-01-25 19:37:58

How to join a table and find a connection?

There is a format table:
SELECT '1'as a,'3'as b, '5' as c
UNION
SELECT ''as a,'3'as b, '5' as c
UNION
SELECT '6'as a,'' as b, '7' as c
UNION
SELECT '6'as a,'3'as b, '' as c
UNION
SELECT '99'as a,'39'as b, '' as c
UNION
SELECT '99'as a,''as b, '98' as c;

+----+----+----+
| a  | b  | c  |
+----+----+----+
| 1  | 3  | 5  |
|    | 3  | 5  |
| 6  |    | 7  |
| 6  | 3  |    |
| 99 | 39 |    |
| 99 |    | 98 |
+----+----+----+

How can you build a query to get as a result:
'a1,a6,b3,c7,c5'
'a99,b39,c98'
?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tester12, 2020-01-26
@tester12

'a'+GROUP_CONCAT(a SEPARATOR ',a')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question