2016-06-09 8 views
0

SELECT WOCHE (Timestamp) AS WEEK EXACT_COUNT_DISTINCT (prods) AS Gesamt FROM mytable GROUP BY 1BigQuery concatatenation

über Abfrage liefert Woche # und total. Ich möchte Woche Spaltenwerte als Woche 21, Woche 22, Woche 23 (von ‚Woche‘ String in der Woche # verketten)

+0

Sie beginnen sollte zeigen einige Versuche zeigen, so einfache Dinge selbst zu adressieren! –

Antwort

1
SELECT 
    'Week ' + STRING(WEEK(day)) AS week, 
    EXACT_COUNT_DISTINCT(prods) AS Total 
FROM mytable 
GROUP BY 1