select `product_hardware_view`.`ProductID`,`product_hardware_view`.`Version`,
`product_hardware_view`.`Price` , `product_software_view`.`Price`
from `product_hardware_view`,`product_software_view`
where `product_hardware_view`.`ProductID` = `product_software_view`.`ProductID`查询出来的结果
id version price price_1
1 1.0.1.1 12 null
2 1.0.2.2 13 null
3 1.0.3.3 14 null
4 1.0.4.4 null 12
5 1.0.5.5 null 13
6 1.0.6.6 null null
7 1.0.7.7 null null用什么样的语句可以把price和price_1在一个列中显示 大虾帮帮忙,小弟在线等
`product_hardware_view`.`Price` , `product_software_view`.`Price`
from `product_hardware_view`,`product_software_view`
where `product_hardware_view`.`ProductID` = `product_software_view`.`ProductID`查询出来的结果
id version price price_1
1 1.0.1.1 12 null
2 1.0.2.2 13 null
3 1.0.3.3 14 null
4 1.0.4.4 null 12
5 1.0.5.5 null 13
6 1.0.6.6 null null
7 1.0.7.7 null null用什么样的语句可以把price和price_1在一个列中显示 大虾帮帮忙,小弟在线等
举例说明
1 1.0.1.1 12
2 1.0.2.2 13
3 1.0.3.3 14
4 1.0.4.4 12
5 1.0.5.5 13
6 1.0.6.6 null
7 1.0.7.7 null 我想要的结果是这样的。
IFNULL(`product_hardware_view`.`Price` , `product_software_view`.`Price`) as Price
from `product_hardware_view`,`product_software_view`
where `product_hardware_view`.`ProductID` = `product_software_view`.`ProductID`