convert_check_key_mem.sql 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. PRAGMA DisableSimpleColumns;
  2. /* postgres can not */
  3. $a = AsList(
  4. AsStruct(255ut AS K, 1 AS V),
  5. AsStruct(127ut AS K, 2 AS V),
  6. AsStruct(0ut AS K, 3 AS V));
  7. $b = AsList(
  8. AsStruct(Int8("-1") AS K, 1u AS V),
  9. AsStruct(Int8("127") AS K, 2u AS V),
  10. AsStruct(Int8("0") AS K, 3u AS V));
  11. $aopt = AsList(
  12. AsStruct(Just(255ut) AS K, 1 AS V),
  13. AsStruct(Just(127ut) AS K, 2 AS V),
  14. AsStruct(Just(0ut) AS K, 3 AS V),
  15. AsStruct(Nothing(ParseType("Uint8?")) AS K, 2 AS V));
  16. $bopt = AsList(
  17. AsStruct(Just(Int8("-1")) AS K, 1u AS V),
  18. AsStruct(Just(Int8("127")) AS K, 2u AS V),
  19. AsStruct(Just(Int8("0")) AS K, 3u AS V),
  20. AsStruct(Nothing(ParseType("Int8?")) AS K, 2u AS V));
  21. select a.K, b.V from as_table($a) as a
  22. join as_table($b) as b on a.K = b.K and a.V = b.V
  23. order by a.K, b.V;
  24. select a.K, b.V from as_table($aopt) as a
  25. join as_table($b) as b on a.K = b.K and a.V = b.V
  26. order by a.K, b.V;
  27. select a.K, b.V from as_table($a) as a
  28. join as_table($bopt) as b on a.K = b.K and a.V = b.V
  29. order by a.K, b.V;
  30. select a.K, b.V from as_table($aopt) as a
  31. join as_table($bopt) as b on a.K = b.K and a.V = b.V
  32. order by a.K, b.V;