30 lines
1.1 KiB
JSON
30 lines
1.1 KiB
JSON
{
|
|
"query": "SELECT s.id, s.nom, COUNT(i.id) as nb_inscrits FROM sequences s LEFT JOIN inscriptions i ON s.id = i.sequenceId AND i.statut = 'confirmee' GROUP BY s.id, s.nom HAVING nb_inscrits > 0 LIMIT 5",
|
|
"command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SELECT s.id, s.nom, COUNT(i.id) as nb_inscrits FROM sequences s LEFT JOIN inscriptions i ON s.id = i.sequenceId AND i.statut = 'confirmee' GROUP BY s.id, s.nom HAVING nb_inscrits > 0 LIMIT 5",
|
|
"rows": [
|
|
{
|
|
"id": "30001",
|
|
"nom": "Groupe A",
|
|
"nb_inscrits": "3"
|
|
},
|
|
{
|
|
"id": "150001",
|
|
"nom": "Groupe 1",
|
|
"nb_inscrits": "1"
|
|
},
|
|
{
|
|
"id": "60001",
|
|
"nom": "Groupe C",
|
|
"nb_inscrits": "4"
|
|
},
|
|
{
|
|
"id": "330001",
|
|
"nom": "test 3",
|
|
"nb_inscrits": "3"
|
|
}
|
|
],
|
|
"messages": [],
|
|
"stdout": "id\tnom\tnb_inscrits\n30001\tGroupe A\t3\n150001\tGroupe 1\t1\n60001\tGroupe C\t4\n330001\ttest 3\t3\n",
|
|
"stderr": "",
|
|
"execution_time_ms": 128
|
|
} |