Joomla在mySQL调用中使用DISTINCT

I'm trying to use DISTINCT to get a list of cities from a column in my DB.

function cityData() {
    $db =& JFactory::getDBO();
    $query = "SELECT DISTINCT MSTCITY FROM " . $db->nameQuote('#__mls') . " ORDER BY MSTCITY;";
    $db->setQuery($query);
    $tbl = $db->loadObjectList();
    return $tbl;
}

Is there something akin to loadObjectList() that I can use ?

There are several options available to get data using database object. You can check this link- http://docs.joomla.org/Accessing_the_database_using_JDatabase/1.5

In your case you can use loadResultArray() in place of loadObjectList.It'll return list of cities as values of an array.

Here's the revised joomla resource page for version 2.5 and 3.x Selecting data using JDatabase. Also since you're already using the loadObjectList() function this question may be better asked as

How to use DISTINCT and JDatabase together

This post has a good solution by Janga_Jack but for your example here's a Joomla 3.x way to accomplish what you need, that allows you to use the convenience methods quote() or q(), quoteName() or qn(), and especially escape() or e().

function cityData() {
    $db =& JFactory::getDBO();
    $query = $db->getQuery(true);

    $fieldlist = $db->qn(array('mls.MSTCITY')); // add the field names to an array
    $fieldlist[0] = 'distinct ' . $fieldlist[0]; //prepend the distinct keyword to the first field name  

    $query->select($fieldlist);
        ->from($db->qn('#__mls', 'mls'))
        ->order($db->qn('mls.MSTCITY'));

    $db->setQuery($query);
    $tbl = $db->loadObjectList();
    return $tbl;
}