Sql Test If Array Contains Integer
I have a SQL TABLE like CREATE TABLE Test ( ContentArray INTEGER ARRAY )`. I can insert an column with `INSERT INTO Test ( ContentArray ) VALUES ( ARRAY[1,2,3,4] ) But I don't kn
Solution 1:
Given the DBMS and some quick research, it looks like SQL2008 supports the ANY keyword to allow this type of query for array datatypes:
SELECT*FROM Test WHERE3=ANY (ContentArray);
I still wouldn't recommend using the array data type for anything non-trivial, I'm not sure what the performance of the above query would be like, but I'm sure it's not as good as a master table with children.
Post a Comment for "Sql Test If Array Contains Integer"