1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] I'm trying to use SQL to create a temporary table that combines two tables, then counts...

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 30, 2024 às 18:32.

  1. Stack

    Stack Membro Participativo

    CREATE TEMP TABLE minuteSleeps
    AS
    SELECT
    secondMinuteSleep.Id AS ID,
    secondMinuteSleep.date AS TIMES,
    secondMinuteSleep.Value AS VALUE,
    secondMinuteSleep.logId as LOGID
    FROM
    `case-study-438019.FitBit.secondMinuteSleep` AS secondMinuteSleep
    JOIN
    `case-study-438019.FitBit.minuteSleep` AS minuteSleep
    ON secondMinuteSleep.value = minuteSleep.value

    SELECT COUNT(value)
    FROM minuteSleeps;


    I tried to create a temporary table called minute sleeps that combines the two tables, scondMinuteSleep and minuteSleep. I want to join the two tables then count the non null values in the column, but instead, I keep getting an error:


    Syntax error: Unexpected keyword SELECT at [15:1]

    I think I may be missing something or the way its set up could be wrong I'm not sure though because this is my first time trying to write code using SQL on my own

    Continue reading...

Compartilhe esta Página