查询此查询的两个表

I'm more stuck on my particular query, as opposed to how to do it

Query

pseudo ~ SELECT * FROM site_locations WHERE "There is an audit in 'audits' with that particular site location

So them separately would be

SELECT * FROM site_locations

SELECT site_locations FROM audits

So, select * the site locations where there's an audit in audits with that site location.

However, there could be multiple audits in audits with that particular site location so I only need to return one count of it.

Entirety

$query = "SELECT * FROM site_locations";
$stmt = $db->prepare($query);
$stmt->execute();
?>
<?php 
    $points = array();
    while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $lat = json_encode($row['latitude']);
        $long = json_encode($row['longitude']);
        $site = json_encode($row['site_name']);

        $point = new stdClass();
        $coords = array();
        $coords[] = floatval($row['latitude']);
        $coords[] = floatval($row['longitude']);
        $point->latLng = $coords;
        $point->name = $row['site_name'];

        array_push($points, $point);
    }
?>
<script>
var points = <?php echo json_encode($points); ?>;
</script>
<script type="text/javascript">
function initMap() {
    $('.map').vectorMap({
        map: 'world_mill_en',
        scaleColors: ['#C8EEFF', '#0071A4'],
        normalizeFunction: 'polynomial',
        hoverOpacity: 0.7,
        hoverColor: false,
        zoomOnScroll: false,
        markerStyle: {
            initial: {
                fill: '#F8E23B',
                stroke: '#383f47'
            }
        },
        regionStyle: {
            initial: {
                fill: '#9f9f9f',
                "fill-opacity": .9,
                stroke: '#fff',
            },
            hover: {
                "fill-opacity": 0.7
            },
            selected: {
                fill: '#1A94E0'
            }
        },
        markerStyle: {
            initial: {
                fill: '#e04a1a',
                stroke: '#FF604F',
                "fill-opacity": 0.5,
                "stroke-width": 1,
                "stroke-opacity": 0.4,
            },
            hover: {
                stroke: '#C54638',
                "stroke-width": 2
            },
            selected: {
                fill: '#C54638'
            },
        },
        backgroundColor: '#f1f4f9',
        markers: points
    });
}
</script>
SELECT * FROM site_locations WHERE site_name in (SELECT site FROM audits)

The above query will return all site_locations (one count of each) which have an entry in audit.