如题:
Select menuid, menuname, parentmenuid, systemlevel
From systemmenuinfo
Where menuid In (Select A.containfunction From usersteaminfo A, userinfo B
                 Where B.username = 'Administrator' And A.recid = B.belongusersteam);
这段语句报错,单独的(Select A.containfunction From usersteaminfo A, userinfo B Where B.username = 'Administrator' And A.recid = B.belongusersteam)返回{1,2,3,4,5,6}其中containfunction 为integer[]类型
menuid 为integer类型将上面的语句改为Select menuid, menuname, parentmenuid, systemlevel
From systemmenuinfo
Where menuid In (1,2,3,4,5,6)
运行正常。

解决方案 »

  1.   

    Select menuid, menuname, parentmenuid, systemlevel
    From systemmenuinfo
    Where array[menuid] <@ (Select A.containfunction From usersteaminfo A, userinfo B
                     Where B.username = 'Administrator' And A.recid = B.belongusersteam);
      

  2.   

    To trainee(春泥) :ERROR:  operator does not exist: integer[] <@ integer[]
    HINT:  No operator matches the given name and argument type(s). You may need to add explicit type casts.其中containfunction 为integer[]类型
    menuid 为integer类型