图示1、是我要查询的表数据,图2、是我查询的结果!问题是我要根据UserID查询具有相同的Key+Value值的结果、查询SQL如下:
Select distinct PropertyName,Value From bimproperties _outer
Where UserId IN (2,3,4) And
(Select COUNT(1) From bimproperties Where UserId IN (2,3,4) and PropertyName+Value=_outer.PropertyName+_outer.Value)=3 And Value<>''
图示1、是我要查询的表数据,图2、是我查询的结果!问题是我要根据UserID查询具有相同的Key+Value值的结果、查询SQL如下: Select distinct PropertyName,Value From bimproperties _outer Where UserId IN (2,3,4) And (Select COUNT(1) From bimproperties Where UserId IN (2,3,4) and PropertyName+Value=_outer.Pr