0

I have a table with various arrays within it like this:

{10574664,10574665,10574679,10574724}
{8616204,10574643,10574644,10574645,10574651,10574688,10574690,10574696,10574708}
{8616208}
{9830397}
{8616203}
{8616204,10574643,10574644,10574645,10574651,10574688,10574690,10574696,10574708}
{8616204,10574643,10574644,10574645,10574651,10574688,10574690,10574696,10574708}
{8616208}
{10574680}
{8616203}

Is there a way to only pull back the records where there is only one element in the array. The results would look like this:

{8616208}
{9830397}
{8616203}
{8616208}
{10574680}
{8616203}

My query would look something like this

Select * from attr_lookup where target_tcode = help with query here

4

1 回答 1

2

使用array_length()

SELECT *
FROM   attr_lookup
WHERE  array_length(target_tcode, 1) = 1;
于 2013-07-24T15:44:21.840 回答