Page 1 of 1

Distinct results from database query

Posted: Mon May 06, 2013 10:07 pm
by scarecity

Is there a way to get distinct results back from a database request? I'm trying to build a nested list app and my first screen is a list of states. I would like each state listed once instead of however many entries are listed in my table.


Distinct results from database query

Posted: Mon May 06, 2013 10:20 pm
by Igor

Distinct results from database query

Posted: Mon May 06, 2013 11:38 pm
by scarecity

Thanks for the quick response Igor.

I've already got the list component setup, I guess I'm not sure where to add the query to filter it down to one item per line. Right now I've got a column called State in appery db and it's currently displaying like so:

California
Oregon
Oregon
Washington
Washington
Washington

I would like it to just be:

California
Oregon
Washington


Distinct results from database query

Posted: Tue May 07, 2013 2:34 am
by Igor

You should change in "Parks_Parks_read_service" next parameters:

"URL" : "{database_url}/collections/Parks/distinct/City"
"Method" : "post"

Please look at "distinct" query in tutorial http://docs.appery.io/documentation/b...