postgresql - Postgres how can I get column inside a quote -
first , foremost using postgres version 9.4 . trying create partial index on query
select distinct on(city,state)city,state,zip zips city ilike '%' , state ilike '%' limit 10
my issue not know how put columns inside quotes '%' partial index looks this
select distinct on(city,state)city,state,zip zips city ilike '{city}%' , state ilike '{state}%' limit 10
what correct method put columns inside single quote mark ? have been looking on place. right partial index looks this
create index "location_search" on zips (city asc nulls last, state asc nulls last) city ilike 'city%' , state ilike 'state%';
which not helping because postgres treating 'city%' , state ilike 'state%' variables , not columns. have search-box users type in city , state fields want optimize. appreciated ...
Comments
Post a Comment