I have tables like:
document:
+-----+---------+
| dId | score |
+-----+---------+
| A | 100 |
| B | 80 |
| C | 70 |
+-----+---------+
entity:
+------+------------+-----+
| name | details | dId |
+------+------------+-----+
| e1 | a | A |
| e2 | a | A |
| e3 | b | B |
| e4 | c | B |
| e5 | d | C |
+------+------------+-----+
Expected Output:
+------+--------+----------+
| dId | score | entities |
+------+--------+----------+
| A | 100 | e1, e2 |
| B | 80 | e3, e4 |
| C | 70 | e5 |
+------+--------+----------+
Current Query:
SELECT
docT.dId,
docT.score,
entityT.name AS entities
FROM
document docT,
entity entityT
LEFT JOIN
document_sentiment docT1
ON
docT1.dId = entityT.dId
Now, I've gone through 1 and 2 which are for SQL-Server.
But I'm looking for Standard SQL Format used by BigQuery.
How can I get the expected output with Standard SQL format?