LINQ In & Not In

 -- 正向 IN 查詢
SELECT * FROM CITYDATA WHERE CITY IN ('TP', 'KH')
 -- 反向 IN 查詢
SELECT * FROM CITYDATA WHERE NOT CITY IN ('TP', 'KH')

// 正向 IN 查詢
var TB = 
  FROM CD IN CITYDATA
  WHERE (New String() {"TP", "TW"}).Contains(cd.City)
  SELECT CD;
// 反向 IN 查詢
var TB = 
  FROM CD IN CITYDATA
  WHERE Not (New String() {"TP", "TW"}).Contains(cd.City)
  SELECT CD;

留言

這個網誌中的熱門文章

delivery note和delivery order的區別和翻譯

Eclipse 3.6.1 Helios 中文化方法

牙技專業英文--技工篇