mysql连接表单独的数据库到表行

时间:2017-09-04 15:37:36

标签: mysql join

我有一个使用两个数据库的查询。 其中一个表中的表名是另一个表中的一行。我需要将这两个结果加入到一个查询中:

var requestsInFlight;

loadAllSpineElements = function(spineElementsCount) {
    requestsInFlight = new Set();
    for (i = 0; i < spineElementsCount; i++) {
        loadAndAppendSpineElement(innerWrapperDiv, pageCounts, requestsInFlight, i);
    }
};

loadAndAppendSpineElement = function(innerWrapperDiv, pageCounts, requestsInFlight, spineElementIndex) {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {

            // Long running dom operation

            requestsInFlight.delete(this);
            if (requestsInFlight.size <= 0) {
                handleAllSpinesLoaded(pageCounts);
            }
        }
    };
    xhttp.open("GET", "file:///localurl");
    xhttp.send();

    requestsInFlight.add(xhttp);
};

cancelAll = function() {
    if (requestsInFlight) {
        for (var it = requestsInFlight.values(), ajax = null; ajax = it.next().value;) {
            ajax.abort();
            requestsInFlight.delete(ajax);
        }
    }
};

有可能加入他们吗? 在这种情况下,$ propertyname是表 SELECT min(`price_client`) AS price From database2.`$propertyname` ($propertyname = name for the table) SELECT internet, text_esp, pool, bedrooms, bathrooms, air, image FROM database1.2buscador where id_propiedad = '$propertyname'

的名称

这就是数据库和表格的样子, 两个数据库都在同一台服务器上:

Alicate_Playa

1 个答案:

答案 0 :(得分:1)

可能但两个DB必须位于同一台服务器上:

override func imageRect(forContentRect contentRect: CGRect) -> CGRect {
    let leftMargin:CGFloat = 40
    let imgWidth:CGFloat = 24
    let imgHeight:CGFloat = 24
    return CGRect(x: leftMargin, y: (contentRect.size.height-imgHeight) * 0.5, width: imgWidth, height: imgHeight)
}

override func titleRect(forContentRect contentRect: CGRect) -> CGRect {
    let leftMargin:CGFloat = 80
    let rightMargin:CGFloat = 80
    return CGRect(x: leftMargin, y: 0, width: contentRect.size.width-leftMargin-rightMargin, height: contentRect.size.height)
}
override func backgroundRect(forBounds bounds: CGRect) -> CGRect {
    let leftMargin:CGFloat = 10
    let rightMargin:CGFloat = 10
    let topMargin:CGFloat = 10
    let bottomMargin:CGFloat = 10
    return CGRect(x: leftMargin, y: topMargin, width: bounds.size.width-leftMargin-rightMargin, height: bounds.size.height-topMargin-bottomMargin)
}
override func contentRect(forBounds bounds: CGRect) -> CGRect {
    let leftMargin:CGFloat = 5
    let rightMargin:CGFloat = 5
    let topMargin:CGFloat = 5
    let bottomMargin:CGFloat = 5
    return CGRect(x: leftMargin, y: topMargin, width: bounds.size.width-leftMargin-rightMargin, height: bounds.size.height-topMargin-bottomMargin)
}