请教,这段SQL语句应该怎么写?
private void Search()
{
string ssql = "select distinct a.STAFF_ID,a.CNNAME,a.DEPT,a.TECHPOS,a.EDULEVEL,a.ATTACH_DATE,b.M_SKILL,b.M_TYPE,c.LANGUAGE ";
ssql += " from D_STAFF_BASE a,D_SKILL_VIEW b,D_STAFF_LANG_ABILITY c ";
//根据姓名查询
if (this.TextBox1.Text.Trim() != " ")
{
ssql += " where a.CNNAME= ' "+this.TextBox1.Text.Trim()+ " ' ";
}
//根据技能查询
if (this.TextBox3.Text.Trim() != " ")
{
ssql += " where b.M_SKILL= ' "+this.TextBox3.Text.Trim()+ " 'or b.M_TYPE= ' "+this.TextBox3.Text.Trim()+ " ' ";
}
//根据语言查询
if (this.Languageddl.SelectedValue!= " ")
{
ssql += " where c.LANGUAGE= ' "+this.Languageddl.DataValueField+ " ' ";
}
//根据职称查询
if (this.Techposddl.SelectedValue != " ")
{
ssql += " where a.TECHPOS= ' "+this.Techposddl.DataValueField+ " ' ";