现在我有两个字符串查询:
SELECT * FROM hmdb WHERE shamsidate MATCH '1376/05/24 1385/11/12'
和,
SELECT * FROM hmdb WHERE hmdb MATCH 'content:red OR keyword:red v_other:true'
这就是我展示每个结果的方式:
public void searchRecords()
{
SQLiteConnection m_dbConnection;
m_dbConnection = new SQLiteConnection("Data Source=hmdb.sqlite;version=3;");
try
{
m_dbConnection.Open();
SQLiteDataAdapter db = new SQLiteDataAdapter(queryString, m_dbConnection);
DataTable dt = new DataTable("hmdb");
db.Fill(dt);
listView1.ItemsSource = dt.DefaultView;
}
catch (Exception e)
{
string ex = e.ToString();
System.Windows.MessageBox.Show(ex);
}
finally
{
if (m_dbConnection != null)
{
m_dbConnection.Close();
m_dbConnection.Dispose();
}
}
}
现在,我想知道如何在这两个查询中获取公共行,以便在我的 listView 中显示它们;或者更好的是,有没有办法只做一个查询并获得所需的结果?