呵呵,可以试一试将语句分开写,也许这个问题应该属于数据库类。或许在SQLSERVER中建立视图可以帮助你。

解决方案 »

  1.   

    select count(*) as num from product ,agent,agentprice where agentprice.cpbm=product.cpbm and agentprice.dlbm=agent.dlbm
    看不出有什么错误,会不会是没有符合条件的记录啊
      

  2.   

    select count(*) as num from product ,agent,agentprice where agentprice.cpbm=product.cpbm(+) and agentprice.dlbm=agent.dlbm(+)
      

  3.   

    zhenyukeji(何处是我家) 这位大哥,(+)放在那里是什么意思啊?
      

  4.   

    相当于sql server中的left join
      

  5.   

    现在好一点了,可以查到num=4有4条记录。但是下面还用这样的sql语句
    select * from product ,agent,agentprice where gentprice.cpbm=product.cpbm(+) and agentprice.dlbm=agent.dlbm(+)
    然后用<%=rs.getString("mc")%>去取不出agent表中的"mc"字段,显示为null,可我那里有记录呢,为什么啊?