1
我有一個MySQL命令象下面這樣:結果差異C#
string listfh = "Select class_id, location_nm, b.ref_desc, c.ref_desc ,a.days From fh_info as a LEFT JOIN (ref_section as b, ref_language as c) ON ((a.section_id=b.cd) and (a.language_id = c.cd)) WHERE year(a.fh_dt) = '2015' And region_id like 'B%' Order by fh_dt desc"; MySqlDataAdapter daFt = new MySqlDataAdapter(listfh, conn); daFt.Fill(dtList);
結果返回NULL。但是當在Navicat Query中運行相同的命令時,它會返回正確的答案(2行)。什麼不對?
你是否有辦法捕獲在Navicat中執行的查詢並與直接運行的查詢進行比較?我不太瞭解MySql,但在Sql Server中,您可以監視運行時沒有太多模糊的查詢。 – xmorera