Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MySQL Group_concat y Group by: https://es.stackoverflow.com/q/82376/29...
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
/* -- ATENCIÓN NO USE DROP TABLE CON SUS TABLAS REALES -- YA QUE DROP TABLE BORRARÁ SUS DATOS -- DROP TABLE SE USA AQUÍ SÓLO PARA PODER PROBAR LOS DATOS */ DROP TABLE IF EXISTS tabla_emitter; /* NO COPIE LA SENTENCIA ^ DROP TABLE ^ EN SUS DATOS REALES */ CREATE TABLE IF NOT EXISTS tabla_emitter ( id SERIAL, emitter INT, reciever INT ); INSERT INTO tabla_emitter (emitter, reciever) VALUES (1,1); INSERT INTO tabla_emitter (emitter, reciever) VALUES (1,2); INSERT INTO tabla_emitter (emitter, reciever) VALUES (1,3); INSERT INTO tabla_emitter (emitter, reciever) VALUES (2,4); INSERT INTO tabla_emitter (emitter, reciever) VALUES (2,5); INSERT INTO tabla_emitter (emitter, reciever) VALUES (2,6); INSERT INTO tabla_emitter (emitter, reciever) VALUES (3,7); SELECT * FROM tabla_emitter; SELECT emitter, reciever FROM tabla_emitter GROUP BY emitter; SELECT emitter, GROUP_CONCAT(reciever SEPARATOR '|') as recivers FROM tabla_emitter GROUP BY emitter;
absolute service time: 0,4 sec
edit mode
|
history
id
emitter
reciever
1
1
1
1
2
2
1
2
3
3
1
3
4
4
2
4
5
5
2
5
6
6
2
6
7
7
3
7
emitter
reciever
1
1
1
2
2
4
3
3
7
emitter
recivers
1
1
1|2|3
2
2
4|5|6
3
3
7