日期:2014-05-16 浏览次数:20912 次
CREATE TABLE tblItem(lngId COUNTER PK, strName TEXT(10) UNIQUE) CREATE TABLE tblAttribute(lngId COUNTER PK,strName TEXT(10) UNIQUE) CREATE TABLE tblItemAttribute(lngIid INTEGER , lngAid Integer)
SELECT tblItem.strName FROM ((tblItem LEFT JOIN tblItemAttribute ON tblItem.lngId=tblItemAttribute.lngIid) LEFT JOIN tblAttribute ON tblItermAttribute.lngAid=tblAttribute.lngId)
select c.* from ((tblItemAttribute a1 inner join tblAttribute b1 on a1.lngAid=b1.lngId and b1.strName='长') inner join (tblItemAttribute a2 inner join tblAttribute b2 on a2.lngAid=b2.lngId and b2.strName='重量') on a1.lngIid=a2.lngIid) inner join tblItem c on a1.lngIid= c.lngId