select `product_list`.`ProductID`,`software_shop_detail`.`Price` + `hardware_shop_detail`.`Price` price
from `product_list`,`software_shop_detail`,`hardware_shop_detail`
where
`product_list`.`ProductID` = `software_shop_detail`.`ProductID`
and 
`product_list`.`ProductID` = `hardware_shop_detail`.`ProductID`
order by `product_list`.`ProductID`怎么查不出数据。在线等。

解决方案 »

  1.   

    using System.wocao;using System;
      

  2.   

    `product_list`,`software_shop_detail`,`hardware_shop_detail`你这三个表中都有数据吗?有符合条件
    `product_list`.`ProductID` = `software_shop_detail`.`ProductID` and `product_list`.`ProductID` = `hardware_shop_detail`.`ProductID`
    的记录吗?
    估计没有!
      

  3.   


    还真的没有。只有满足`product_list`.`ProductID` = `software_shop_detail`.`ProductID`或者满足`product_list`.`ProductID` = `hardware_shop_detail`.`ProductID`
    的,因为`software_shop_detail`.`ProductID`是1-8,`hardware_shop_detail`.`ProductID`
    是10-20.但是我要同时查出所有产品及价格,在product_list表中是没有价格的,我该怎么查。
      

  4.   

    建议你列出你的表结构,并提供测试数据以及基于这些测试数据的所对应正确结果。
       参考一下这个贴子的提问方式http://forum.csdn.net/BList/OtherDatabase
       
       1. 你的 create table xxx .. 语句
       2. 你的 insert into xxx ... 语句
       3. 结果是什么样,(并给以简单的算法描述)
       
       这样想帮你的人可以直接搭建和你相同的环境,并在给出方案前进行测试。