MYSQL有多个SUBQUERIES

时间:2015-05-18 01:17:54

标签: mysql correlated-subquery in-subquery

嗨,谢谢你的阅读。

SELECT DISTINCT (thisID and thisNAME) from table1 WHERE thisID IN
(SELECT id from table2 WHERE ... condtions)
OR 
(SELECT id from table3 WHERE ... different condtions)
OR 
(SELECT id from table99 WHERE ...even more conditions)

我需要执行一些SELECTS以提供此ID的nu,如果我有这些,我需要从表1中仅选择thethisID和thisNAME。

我必须承认我在编写查询时有点不自觉...但我确定我在正确的路线上?请帮忙吗?

1 个答案:

答案 0 :(得分:1)

你的SQL非常接近。你需要重复<script type="text/javascript"> $(document).ready(function() { //previous code calculating lat & lng, etc var lat = 1234; var lng = 5678; showMap(lat, lng); }); function showMap(lat,lng) { var apikey = "asdfasdfasdfasdf"; var code = "<iframe width='480' height='320' frameborder='0' style='border:0' src='https://www.google.com/maps/embed/v1/view?zoom=14&center=" + lat + "," + lng + "&key=" + apikey + "'></iframe>"; console.log(code); //outputs good code $("#map").html(code); } </script> 部分并修复一些外语句法:

IN