You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATEFUNCTIONget_jobs (orgId varchar, pagesize integer, pagenum integer)
RETURNS TABLE (
job_id varchar)
LANGUAGE plpgsql
AS $$
BEGIN
RETURN QUERY WITH filtered_jobs AS (
SELECTj.idAS job_id
FROM
jobs j
ORDER BYj.created_atDESCLIMIT pageSize OFFSET pageSize * (pageNum -1)
),
subtask AS (
SELECTfj.job_idFROM
filtered_jobs fj
),
counts AS (
SELECTss.job_id,
COUNT(*) AS num,
COUNT(*) AS total_sub_tasks
FROM
subtask ss
)
SELECTj.job_idFROM
filtered_jobs j
END;
$$;
One issue is subtask AS ( is not properly indentened. Similar to #213
The other issue is COUNT(*) AS total_sub_tasks .
The text was updated successfully, but these errors were encountered:
ray-x
changed the title
Bad indentation for CTE and Count(*) AS in return query statement
Bad indentation for CTE and Count(*) AS in return query statement
Aug 28, 2021
Here is the code been formatted
One issue is
subtask AS (
is not properly indentened. Similar to #213The other issue is
COUNT(*) AS total_sub_tasks
.The text was updated successfully, but these errors were encountered: