Advertisement
popov-aa

Untitled

Dec 9th, 2024
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.37 KB | None | 0 0
  1. CREATE TABLE my_table1
  2. (
  3.     id BigSerial NOT NULL,
  4.     LENGTH UInt32,
  5.     ama Utf8,
  6.     ama1 DECIMAL(22,9),
  7.     ama2 DyNumber,
  8.     PRIMARY KEY (id)
  9. );
  10.  
  11. $ama = "123456789012345678901234567890"; -- 30
  12. INSERT INTO my_table1  (LENGTH, ama, ama1, ama2) VALUES (Unwrap(len($ama)), $ama, DECIMAL($ama, 22, 9), DyNumber($ama));
  13.  
  14. $ama = "1234567890123456789012345"; -- 25
  15. INSERT INTO my_table1  (LENGTH, ama, ama1, ama2) VALUES (Unwrap(len($ama)), $ama, DECIMAL($ama, 22, 9), DyNumber($ama));
  16.  
  17. $ama = "123456789012345"; -- 15
  18. INSERT INTO my_table1  (LENGTH, ama, ama1, ama2) VALUES (Unwrap(len($ama)), $ama, DECIMAL($ama, 22, 9), DyNumber($ama));
  19.  
  20. $ama = "12345678901234"; -- 14
  21. INSERT INTO my_table1  (LENGTH, ama, ama1, ama2) VALUES (Unwrap(len($ama)), $ama, DECIMAL($ama, 22, 9), DyNumber($ama));
  22.  
  23. $ama = "1234567890123"; -- 13
  24. INSERT INTO my_table1  (LENGTH, ama, ama1, ama2) VALUES (Unwrap(len($ama)), $ama, DECIMAL($ama, 22, 9), DyNumber($ama));
  25.  
  26. $ama = "1234567890"; -- 10
  27. INSERT INTO my_table1  (LENGTH, ama, ama1, ama2) VALUES (Unwrap(len($ama)), $ama, DECIMAL($ama, 22, 9), DyNumber($ama));
  28.  
  29. -- Результат inf:
  30. SELECT
  31. SUM(ama1) AS s2,
  32. --sum(ama2) as s3 -- Unsupported column type: DyNumber
  33. FROM my_table1;
  34.  
  35. -- Результат число:
  36. SELECT
  37. SUM(ama1) AS s2,
  38. --sum(ama2) as s3 -- Unsupported column type: DyNumber
  39. FROM my_table1 WHERE LENGTH < 14;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement