fork download
  1. Subquery on line 27 fails to reference table aliases a and b
  2.  
  3. > no such column: a.action
  4. > no such column: b.action
  5.  
  6.  
  7.  
  8. select
  9. action,
  10. count(*) as runs,
  11. sum(errors) as errors,
  12. count(*) filter (where errors > 0) / count(*) * 100 as errors_ptc,
  13. avg(length) filter (where errors = 0) as avg_length,
  14. max(length) filter (where errors = 0) as max_length,
  15. min(length) filter (where errors = 0) as min_length,
  16. (
  17. select length
  18. from actions as b
  19. where
  20. b.action = a.action
  21. and errors = 0
  22. and created_at between 1739285873236 and 1739287673236
  23. order by length
  24. limit 1
  25. offset round(
  26. (
  27. select count(*) from actions where action = a.action and errors = 0 and created_at between 1739285873236 and 1739287673236
  28. ) * 0.95
  29. )-1
  30. ) as qtile_95
  31. from actions as a
  32. where created_at between 1739285873236 and 1739287673236
  33. group by action;
  34.  
Success #stdin #stdout #stderr 0.01s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: near line 1: near "Subquery": syntax error