I'm trying to create a search field (using Solspace Super Search) using a location from existing channel entries. Unfortunately this results in duplicate locations as some entries use the same location.
I explored removing duplicates using javascript but this doesn't play nicely with Super Search so I've been advised to try using an SQL query.
Here's the code I currently have but it doesn't appear to be working as it's outputting loads of duplicates now rather than just a few.
<select id="locationList" name="club_feed_town">
<option value="">All Locations</option>
{exp:channel:entries
channel="friendship_clubs_data_feed"
dynamic="no"
status="Open|Exclude from search results"
orderby="club_feed_town"
sort="asc"
}
{exp:query sql="SELECT DISTINCT field_id_174 FROM exp_channel_data"}
<option value="{club_feed_town}">{club_feed_town}</option>
{/exp:query}
{/exp:channel:entries}
</select>
Any ideas where I'm going wrong?
Thanks in advance,
Tom