[ create a new paste ] login | about

Link: http://codepad.org/wyesDSCX    [ raw code | output | fork ]

C, pasted on Sep 5:
  WITH j AS (
      SELECT uuid_generate_v4()                                     AS uuid,
             location."userId",
             location."deviceId",
             st_makeline(location.shape)                            AS shape,
             date_trunc('day' :: text, location."creationDateTime") AS date
      FROM (SELECT olocations.id,
                   olocations."userId",
                   olocations."deviceId",
                   olocations."creationDateTime",
                   olocations.shape
            FROM olocations
            GROUP BY olocations.id, olocations."creationDateTime"
            ORDER BY olocations."creationDateTime") location
      WHERE ((location."deviceId" = '89984320001415261239' :: text) AND
             (location."userId" = 'b6951aea-0909-4cd6-bd92-71e727cc39ec' :: uuid))
      GROUP BY location."deviceId", location."userId", (date_trunc('day' :: text, location."creationDateTime"))
  )
  SELECT uuid_generate_v4()                                   AS uuid,
         j."deviceId",
         j.date,
         st_astext(st_multi(st_linemerge(st_union(j.shape)))) AS multiline
  FROM j
  GROUP BY j.date, j."deviceId"
  ORDER BY j.date
  LIMIT 1;


Output:
1
2
3
4
5
Line 1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'j'
Line 24: warning: multi-character character constant
Line 36: warning: character constant too long for its type
Line 34: warning: character constant too long for its type
Line 67: warning: multi-character character constant


Create a new paste based on this one


Comments: