如何在具有父子关系的表中获取订单父子的查询结果然后paren-child?

时间:2017-08-04 02:36:36

标签: sql database

如何将查询结果作为下面的图片获取?

文本字段是随机文本(不是按字母顺序排列的图片)。 enter image description here

2 个答案:

答案 0 :(得分:1)

对于您提供的数据,order by text有效。但是,这可能不是您想要做的通用解决方案,除非节点的名称(如您的示例中所示)遵循非常设置的模式。

答案 1 :(得分:0)

按升序排序

window.drawIMG = function() {
    console.log("Getting image");
    var src = imgURLText;
    var img = document.createElement("img");
    img.src = src;

    var canvas = document.createElement("canvas");
    canvas.width = document.body.clientWidth;
    canvas.height = document.body.clientHeight;
    canvas.getContext('2d').drawImage(img, (canvas.width / 2) - (canvas.width / 2), 0, canvas.width, canvas.height);

    console.log("Start draw");

    for(x = 0; x < document.body.clientWidth; x = x + 10){
        for(y = 0; y < document.body.clientHeight; y = y + 10){
            color = canvas.getContext('2d').getImageData(x, y, 1, 1).data;
            hexColor = rgb2hex(color);

            mode.pickColor(hexColor);

            // Start drawing a line
            startLine(x,y);

            // Insert point in line
            linePoint(x,y);
            console.log("Point: " + x + ", " + y);

            // Stop drawing line
            endLine();

            // If this was successful, send to clients and clear array
            if(mode.points.length>0){
                mode.sendDrawData(mode.points);
                console.log("points length: "+mode.points.length);
                mode.points = [];
            }
        }
    }

    canvas.remove();
    console.log("End draw");
};