你要干吗?什么问题啊?是想得到效果吗?
第一个下拉彩旦用select zstyle from table
第二个用select zname from zstyle where zstyle ='"+ComboBox1->Text+"'

解决方案 »

  1.   

    select Zname from tablename where Zstyle ='办公用品'
      

  2.   

    动态用SQL语句select distinct Zstyle from 表 
    取出Zstyle,然后添加到下来菜单用一个Query1,设置SQL语句位select Zname from 表 where Zstyle=:Pstyle 
    然后在第一个下来菜单的ONchange事件写代码
    然后传入参数Pstyle的值为第一个下拉菜单的text
       然后将找到的Zname循环加到第二个Item里就OK了
      

  3.   

    declare @style varchar(20)
    set @style = '办公用品'
    select * from 表 where Zstyle = @style
      

  4.   

    楼主的意思好象不是在求sql语句
    好象是在用某门语言写出这样的操作。
      

  5.   

    select distinct Zstyle from 表 
    取出Zstyle,然后添加到下拉菜单中。第二步,就可以根据你所选取的Zstyle,
    把值传递给变量@Zstyle ,然后
    select distinct zname from 表 where Zstyle =@Zstyle 
    莱得到你的第二个列表。。
      

  6.   

    如果是VB中,可以这样:设置一个combo控件
    用:
    re.open "select distinct Zstyle from 表"
    得到类别,填到combo控件中然后在其click事件中,调用下面的sql语句来查询:
    re.open "select * from 表 where Zstyle='" & combo1 & "'"
      

  7.   

    在你程序里的第一个下拉菜单中写OnChange()事件吧!