本帖最后由 vicenic 于 2011-07-29 16:24:17 编辑

解决方案 »

  1.   

    select distinct(工点名称) from XSdcTable 
    union 
    select distinct(工点名称) from XStpTable 
    union 
    select distinct(工点名称) from XSkcTable 
    union 
    select distinct(工点名称) from XSsjTable 
    union 
    select distinct(工点名称) from XStjTable
    union all不去重的哦,用union
      

  2.   

    select 工点名称 from(
    select distinct 工点名称 from XSdcTable
     union 
    select distinct 工点名称 from XStpTable
     union
    select distinct 工点名称 from XSkcTable
     union
    select distinct 工点名称 from XSsjTable
     union
    select distinct 工点名称 from XStjTable
    )t
      

  3.   

    我说的只是sql里的你要获取这个数据的方式
    不过你= '" + listBox1.Text + "'"; 
    这个是啥?还有个字段要等于你这个值?那就应该是where 字段=...
    你where都没能不报错么- -