Jump to content

Selecting Unique value for mysql database


rstewar

Recommended Posts

Is there a way to select only unique records from a database, where only one value is unique? I want to be able to select unique values for 'university_1', but 'latitude' and 'longitude' do not have to be unique.

$sql = "SELECT university_1, latitude, longitude FROM stores ";
        $sql .= "WHERE state='$state' AND ";
        $sql .= "latitude BETWEEN '$min_lat' AND '$max_lat'
               AND longitude BETWEEN '$min_lon' AND '$max_lon'
               AND approved=1 AND status=1";

 

Thanks for any help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.