Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
array comparison
--PostgreSQL 9.6 --'\\' is a delimiter select '{1,2,3}'::int[] = '{3,2,1}'::int[], --false '{1,2,3}'::int[] && '{3,2,1}'::int[], --true, but see next example '{1,2,3}'::int[] && '{3,2,1, 4}'::int[], -- as you see that additional element did not make the result false, '{1,2,3}'::int[] && '{3,2,1, 4}'::int[] and array_length('{1,2,3}'::int[], 1) = array_length('{3,2,1, 4}'::int[], 1), -- as you see that additional element did not make the result false, '{1,2,3}'::int[] && '{3,2,1, 4}'::int[] and array_length('{1,2,3}'::int[], 1) = array_length('{3,2,1}'::int[], 1) -- valid comparison
run
|
edit
|
history
|
help
0
user
cpana
SQL social network practice by Han Wang 20200720 - 2
Pivot the Hard Way..
Krug_test
1
Ecommerce Website Analysis by SQL
SQL Practice Sample: Movie Database
to_char(now(), 'YYYYddd')
Black Wall