例如,要在一张表“成绩记录”中查询“班级”为“9班”,“数学”>“90”
要怎么办?
5 个解决方案
#1
谁帮我啊?在线等~~~
分数不是关键,急用……
请高手帮忙
分数不是关键,急用……
请高手帮忙
#2
SELECT * FROM 成绩表 WHERE 班级 = 9 AND 数学 > 90
#3
select * from 成绩记录
where 班级=9班
and 数学>90
where 班级=9班
and 数学>90
#4
select * from 成绩记录
where 班级=9
and 数学>90
where 班级=9
and 数学>90
#5
record.CreateInstance("ADODB.Recordset");
record->Open("SELECT * FROM pi",_variant_t((IDispatch *)connect,true),adOpenStatic,adLockOptimistic,adCmdText);
_variant_t v1,v2,v3,v4,v5;
CString a1;
CString a2;
CString a3;
CString a4;
CString a5;
record->MoveFirst();
int a=0;
while(!record->adoEOF)
{
v1=record->GetCollect("xinghao");
v2=record->GetCollect("zhupin");
v3=record->GetCollect("neicun");
v4=record->GetCollect("piweishu");
v5=record->GetCollect("shijian");
a1.Format("%s",(LPCTSTR)(_bstr_t)v1);
a2.Format("%s",(LPCTSTR)(_bstr_t)v2);
a3.Format("%s",(LPCTSTR)(_bstr_t)v3);
a4.Format("%s",(LPCTSTR)(_bstr_t)v4);
a5.Format("%s",(LPCTSTR)(_bstr_t)v5);
m_list.InsertItem(a,a1);
m_list.SetItemText(a,1,a2);
m_list.SetItemText(a,2,a3);
m_list.SetItemText(a,3,a4);
m_list.SetItemText(a,4,a5);
record->MoveNext();
a++;
}
record->Open("SELECT * FROM pi",_variant_t((IDispatch *)connect,true),adOpenStatic,adLockOptimistic,adCmdText);
_variant_t v1,v2,v3,v4,v5;
CString a1;
CString a2;
CString a3;
CString a4;
CString a5;
record->MoveFirst();
int a=0;
while(!record->adoEOF)
{
v1=record->GetCollect("xinghao");
v2=record->GetCollect("zhupin");
v3=record->GetCollect("neicun");
v4=record->GetCollect("piweishu");
v5=record->GetCollect("shijian");
a1.Format("%s",(LPCTSTR)(_bstr_t)v1);
a2.Format("%s",(LPCTSTR)(_bstr_t)v2);
a3.Format("%s",(LPCTSTR)(_bstr_t)v3);
a4.Format("%s",(LPCTSTR)(_bstr_t)v4);
a5.Format("%s",(LPCTSTR)(_bstr_t)v5);
m_list.InsertItem(a,a1);
m_list.SetItemText(a,1,a2);
m_list.SetItemText(a,2,a3);
m_list.SetItemText(a,3,a4);
m_list.SetItemText(a,4,a5);
record->MoveNext();
a++;
}
#1
谁帮我啊?在线等~~~
分数不是关键,急用……
请高手帮忙
分数不是关键,急用……
请高手帮忙
#2
SELECT * FROM 成绩表 WHERE 班级 = 9 AND 数学 > 90
#3
select * from 成绩记录
where 班级=9班
and 数学>90
where 班级=9班
and 数学>90
#4
select * from 成绩记录
where 班级=9
and 数学>90
where 班级=9
and 数学>90
#5
record.CreateInstance("ADODB.Recordset");
record->Open("SELECT * FROM pi",_variant_t((IDispatch *)connect,true),adOpenStatic,adLockOptimistic,adCmdText);
_variant_t v1,v2,v3,v4,v5;
CString a1;
CString a2;
CString a3;
CString a4;
CString a5;
record->MoveFirst();
int a=0;
while(!record->adoEOF)
{
v1=record->GetCollect("xinghao");
v2=record->GetCollect("zhupin");
v3=record->GetCollect("neicun");
v4=record->GetCollect("piweishu");
v5=record->GetCollect("shijian");
a1.Format("%s",(LPCTSTR)(_bstr_t)v1);
a2.Format("%s",(LPCTSTR)(_bstr_t)v2);
a3.Format("%s",(LPCTSTR)(_bstr_t)v3);
a4.Format("%s",(LPCTSTR)(_bstr_t)v4);
a5.Format("%s",(LPCTSTR)(_bstr_t)v5);
m_list.InsertItem(a,a1);
m_list.SetItemText(a,1,a2);
m_list.SetItemText(a,2,a3);
m_list.SetItemText(a,3,a4);
m_list.SetItemText(a,4,a5);
record->MoveNext();
a++;
}
record->Open("SELECT * FROM pi",_variant_t((IDispatch *)connect,true),adOpenStatic,adLockOptimistic,adCmdText);
_variant_t v1,v2,v3,v4,v5;
CString a1;
CString a2;
CString a3;
CString a4;
CString a5;
record->MoveFirst();
int a=0;
while(!record->adoEOF)
{
v1=record->GetCollect("xinghao");
v2=record->GetCollect("zhupin");
v3=record->GetCollect("neicun");
v4=record->GetCollect("piweishu");
v5=record->GetCollect("shijian");
a1.Format("%s",(LPCTSTR)(_bstr_t)v1);
a2.Format("%s",(LPCTSTR)(_bstr_t)v2);
a3.Format("%s",(LPCTSTR)(_bstr_t)v3);
a4.Format("%s",(LPCTSTR)(_bstr_t)v4);
a5.Format("%s",(LPCTSTR)(_bstr_t)v5);
m_list.InsertItem(a,a1);
m_list.SetItemText(a,1,a2);
m_list.SetItemText(a,2,a3);
m_list.SetItemText(a,3,a4);
m_list.SetItemText(a,4,a5);
record->MoveNext();
a++;
}