我有三个表first
second
和f_s
,它们将两个表连接在一起,如下所示
first_id │ first second_id │ second first_id │ second_id
1 station 1 address 1 1
2 hospital 2 point 1 2
3 hotel 2 1
2 2
3 1
对于给定的second.second_id
,我需要second.second
和first.first
。我该如何编写mySQL查询?
示例: station
:
first │ second_id│ second
station 1 address
station 2 point
答案 0 :(得分:0)
这将是三个表的简单连接。
var arr1 = ["a1", "a2", "a3", "a4", "a5"]
var arr2 = ["b1", "b2", "b3", "b4", "b5"]
newArr = []
t1 = t2 = temp = []
while(arr1.length) {
t1 = arr1.splice(0,3)
t2 = arr2.splice(0,3)
temp = t1.concat(t2)
newArr = newArr.concat(temp)
}
console.log(newArr)