我有一個有多個條件對第LINQ多個條件「的」條款
SELECT *
FROM
CATALOGITEM with (nolock) INNER JOIN CATALOG with (nolock) ON
CATALOGITEM.catalog_id = CATALOG.catalog_id and not(catalog.catalog_id = 21) AND NOT(catalog.catalog_id = 20)
INNER JOIN PRODUCT with (nolock) ON
CATALOGITEM.s_num = PRODUCT .s_num
LEFT OUTER JOIN PRODUCT_DETAIL with (nolock) ON
PRODUCT_DETAIL.s_num = PRODUCT.s_num
WHERE
(
CATALOGITEM.publish_code = 'upd' OR
CATALOG_ITEM.publish_code = 'ins' OR
PRODUCT.publish_code = 'upd' OR
PRODUCT.publish_code = 'ins'
)
and
(CATALOG.unit_id = bu.unit_id)
如何在LINQ寫這個查詢。
請指教。
將附加條件移到'where'。順便說一句 – 2010-06-07 09:55:36
,最好使用SQL操作'IN':'.. WHERE CATALOGITEM.publish_code IN( 'UPD '插件')或PRODUCT.publish_code IN(' UPD」, '插件')' – abatishchev 2010-06-07 10:02:36