Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Ronny Kibet
Ronny Kibet
47,409 Points

How do I query parse data in parse.

Hi there I would like to query if a value exists anywhere in the table. SO for example I have a "Book" class in parse that contains book title, book author column names. How would I query to check if a value exists in any or both fields in the rows?

Thanks.

2 Answers

Hayden Taylor
Hayden Taylor
5,076 Points

is this in any language? in sql you could create a case to check that column name in a certain table exists by returning 1 or 0 (true or false).

You could then you logical operators AND / OR in which ever way you wanted to include or exclude more search terms.

Simple CASE expression: 
CASE input_expression 
     WHEN when_expression THEN result_expression [ ...n ] 
     [ ELSE else_result_expression ] 
END 
Searched CASE expression:
CASE
     WHEN Boolean_expression THEN result_expression [ ...n ] 
     [ ELSE else_result_expression ] 
END

source: http://msdn.microsoft.com/en-us/library/ms181765.aspx