열이있는이 Google 융합 표가 "date"
, "name"
및 "origin"
입니다. "name"
및 "origin"
과 같은 다른 데이터를 조작하여 내 웹 페이지에 표시 할 수 있도록 "date"
열에서 데이터를 검색하고 싶습니다. 나는이 알고리즘을 염두에두고 있지만 올바른 구문을 모르는 사람이 나를 도와 줄 수 있습니까? 나는 자바 스크립트에 새로운 오전부터융합 표에서 데이터를 가져 오는 중
Select column "date" from my fusion table;
then there should be a for loop to search the data under this column;
if(a specific date has been found)
{
then display the "name" and "origin" data that falls
unto this date
}
, 누군가가 올바른 자바 스크립트 구문 또는 코드 스크립트 스 니펫에이를 만들 수 있습니다 :
내 알고리즘이입니다. 고마워.
편집 :
가 이미이 코드를 가지고 :
<html>
<head>
<title>Google Fusion Tables API Example</title>
</head>
<body>
<div id="content"></div>
<script>
function handler(response) {
var contentStr = "<table>";
for (var i = 0; i < response.rows.length; i++) {
var item = response.rows[i];
contentStr += "<tr>";
for (var j = 0; j < item.length; j++) {
contentStr += "<td>" + item[j]+"</td>";
}
contentStr += "</tr>";
}
contentStr += "</table>";
document.getElementById("content").innerHTML = contentStr;
}
</script>
<script src="https://www.googleapis.com/fusiontables/v1/query?sql=SELECT%20destination%2C%20departure%20FROM%201fbsgSzpi7TRoyHAVFN82JwsaU5tjfB0akJmAapRm&key=AIzaSyB9lGkRr185Oen4WlR7gTYxzFYoNQ0cfSk&callback=handler"></script>
</body>
</html>
무엇 그냥 융합 테이블을 표시한다 않습니다. 어떻게 나는 그 쿼리를 유혹 할 것인가? 내 말은 필터를 점진적으로 바꿀 수 있도록 쿼리 URL을 함수에 넣는 방법 만 알고 있으면 for 루프에 넣고 특정 날짜를 필터링하는 것입니다. 누군가? date
칼 럼 당신이 몇 가지 가능한 옵션을 찾을 수 있습니다 유형의 DATETIME가있을 때 당신은 https://developers.google.com/fusiontables/docs/v1/sql-reference#Select
에서 문서를 찾을 수 있습니다
SELECT * FROM yourTableId where date='value'
:
"display"(FusionTablesLayer 또는 다른 곳에서) 및 "특정 날짜"... 특정 날짜의 행만 가져 오시겠습니까? –
예 특정 날짜의 행만 가져 오려고합니다. – user2272420