当前位置: 动力学知识库 > 问答 > 编程问答 >

MySql PHP Combine Select Queries

问题描述:

3 types of information I need from database I know how to get all products ids available in the database but I also want to get the price and the attribute for each productid and have it in a php loop to be able to insert it to other table all information combined

I just want to combine all this 3 infromation and insert into custom table how can I combine it or should I loop to get price + attribute for each product ID?

网友答案:

Shouldn't it be as simple as -

SELECT `cpet`.`Product_ID`, `cpet`.`Product Price`, `cpet`.`Product Attribute` 
FROM `catalog_product_entity_text` AS `cpet`
JOIN `catalog_product_entity` AS `cpe`
ON `cpet`.`Product_ID` = `cpe`.`entity_id`
WHERE `cept`.`attribute_id` = '139'
分享给朋友:
您可能感兴趣的文章:
随机阅读: