c# - Linq, date comparison -
i need npgsql query convert linq query. npgsql looks like:
p.cmd = new npgsqlcommand("select distinct min(h_dt::date) w_h " + "inner join on h_us_id = us_id " + "where cat_id != '' , h_dt::date not in (select distinct period_date m_v " + "where mv_id = 1)", conn);
i try convert:
var q = (from t in context.w_h join t1 in context.us on t.h_us_id equals t1.us_id t1.cat_id != "" select t.h_dt) .min();
i need in adding part of comparison:
and h_dt::date not in (select distinct period_date m_v)
h_dt::date - return date in format yyyy-mm-dd
have collection hold results:
// pseudocode ! write selection here: var v = select distinct period_date m_v
and compare contains:
q.where(i=> ! v.contains(i) );
Comments
Post a Comment