Sql查询返回"子查询返回超过1行"

时间:2017-08-25 07:01:16

标签: mysql sql

SELECT *, (SELECT fsi.active
           FROM filters_sorts  AS fsi
           WHERE fs.`active`= '1' AND fs.`parent` !='0')
FROM filters_sorts  AS fs
WHERE fs.`active`= '1' AND fs.`parent` ='0';

table image

1 个答案:

答案 0 :(得分:0)

请改用以下查询:

// 1. Open the page
page.open('file:///c:/temp/chart.html', function(status) {

    // 2. Make adjustments
    page.evaluate(function() {
        /// Do stuff
    });

    // 3. Make screenshot, but not before waiting 5 seconds 
    // for browser to catch up with step 2.
    setTimeout(function(){

      page.render('after_change.png');
      phantom.exit();

    }, 5000);

});

您可以在SELECT fs1.name menuName, fs1.id menuId, fs2.id subMenuId, fs2.name subMenuName FROM filters_sorts fs1 LEFT JOIN filters_sorts fs2 ON fs1.id = fs2.parent WHERE fs1.parent=0

中添加所需的字段

如果您想为一个主要类别添加一行,则可以执行以下操作:

SELECT