这条SQL语句我看不懂,能不能 解释一下?select currentid,jamid,dealerid,inputtime,dealtime,ms from ytwjam,gdzt where currentid= '" & ffind.Text & " ' and adsljam.jamstate=gdzt.bm 

解决方案 »

  1.   

    select currentid,jamid,dealerid,inputtime,dealtime,ms from ytwjam,gdzt这是从两个表中查询.可以理解为连表。where后面的 and adsljam.jamstate=gdzt.bm 就是连表条件。而
    where后面的currentid= '" & ffind.Text & " ' 这个应该是过滤条件。这个应该是VB中写的。让currentid=  ffind这个文本框的值。可以理解为
    declare @text varchar(200)
    set @text='....'
    where currentid=@text
    跟这本质是一样的。
      

  2.   

    select currentid,jamid,dealerid,inputtime,dealtime,ms from ytwjam,gdzt where currentid= '" & ffind.Text & " ' and adsljam.jamstate=gdzt.bm 从ytwjam,gdzt 二表中以adsljam.jamstate与gdzt.bm为公共字段进行连接!筛选条件为
    currentid为ffind.Text,并在上述条件为基础的前提下,将符合条件的currentid,jamid,dealerid,inputtime,dealtime,ms from ytwjam,gdzt显示出来