我用VB做两个条件的查询时遇到问题,请高手帮我写个SQL语句。
PrivateSubForm_Load()Combo1.AddItem("学号")Combo1.AddItem("姓名")Combo1.AddItem("年龄")Comb...
Private Sub Form_Load()
Combo1.AddItem ("学号")
Combo1.AddItem ("姓名")
Combo1.AddItem ("年龄")
Combo1.AddItem ("性别")
Combo1.AddItem ("系院")
Combo1.ListIndex = 0
Combo2.AddItem ("=")
Combo2.AddItem (">")
Combo2.AddItem (">=")
Combo2.AddItem ("<")
Combo2.AddItem ("<=")
Combo2.AddItem ("<>")
Combo2.ListIndex = 0
Combo3.AddItem ("AND")
Combo3.AddItem ("OR")
Combo3.ListIndex = 0
Combo5.AddItem ("=")
Combo5.AddItem ("<>")
Combo5.ListIndex = 0
End Sub 展开
Combo1.AddItem ("学号")
Combo1.AddItem ("姓名")
Combo1.AddItem ("年龄")
Combo1.AddItem ("性别")
Combo1.AddItem ("系院")
Combo1.ListIndex = 0
Combo2.AddItem ("=")
Combo2.AddItem (">")
Combo2.AddItem (">=")
Combo2.AddItem ("<")
Combo2.AddItem ("<=")
Combo2.AddItem ("<>")
Combo2.ListIndex = 0
Combo3.AddItem ("AND")
Combo3.AddItem ("OR")
Combo3.ListIndex = 0
Combo5.AddItem ("=")
Combo5.AddItem ("<>")
Combo5.ListIndex = 0
End Sub 展开
展开全部
t as #1
rs.open "select * from table_a where 字段1 not in (select 字段1 from table_b)",conn
while not rs.eof
print #1,rs("字段1")
rs.movenext
wend
rs.close
close #1
open "c:\2.txt" for input as #1
rs.open "select * from table_a where 字段1 in (select 字段1 from table_b)",conn
while not rs.eof
print #1,rs("字段1")
rs.movenext
wend
rs.close
close #1
rs.open "select * from table_a where 字段1 not in (select 字段1 from table_b)",conn
while not rs.eof
print #1,rs("字段1")
rs.movenext
wend
rs.close
close #1
open "c:\2.txt" for input as #1
rs.open "select * from table_a where 字段1 in (select 字段1 from table_b)",conn
while not rs.eof
print #1,rs("字段1")
rs.movenext
wend
rs.close
close #1
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询