pg_compare.sql 763 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. /* dq can not */
  4. /* dqfile can not */
  5. /* yt can not */
  6. pragma warning("disable", "4510");
  7. pragma warning("disable", "1108");
  8. -- a > 2
  9. select YQL::RangeComputeFor(
  10. Struct<a:PgInt4,b:PgText>,
  11. ($row) -> (FromPg(PgOp(">", $row.a, 2p)) ?? false),
  12. AsTuple(AsAtom("a"))
  13. );
  14. -- a >= 2
  15. select YQL::RangeComputeFor(
  16. Struct<a:PgInt4,b:PgText>,
  17. ($row) -> (($row.a >= 2p) ?? false),
  18. AsTuple(AsAtom("a"))
  19. );
  20. -- b < 2
  21. select YQL::RangeComputeFor(
  22. Struct<a:PgInt4,b:PgText>,
  23. ($row) -> (('2'p > $row.b) ?? false),
  24. AsTuple(AsAtom("b"))
  25. );
  26. -- b <= 2
  27. select YQL::RangeComputeFor(
  28. Struct<a:PgInt4,b:PgText>,
  29. ($row) -> (FromPg(PgOp(">=", '2'p, $row.b)) ?? false),
  30. AsTuple(AsAtom("b"))
  31. );