Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要检查所有数字是否相同。这些值来自不同的列。签名应该允许放置任意数量的列(如COALESCE(...)方法)
COALESCE(...)
SELECT equality(42, 42, 42)
应该返回true并且
true
SELECT equality(23, 42, 133)
应该返回false。
false
有没有一种很好的编码方式?
当时我是这样做的:
SELECT (x1 = x2 AND x2 = x3);
但我希望有一种更优雅的方式。
SELECT GREATEST(42, 42, 42) = LEAST(42, 42, 42)