Roger Could you perhaps concatenate the user + car columns to make a new key and then do a select from that?
e.g select * from ( select *, concat(user,car) as myKey from yourTable ) and use an appropriate where clause on that? Though it's not entirely clear what your requirement is. HTH cheers Alan -- Alan Stenhouse alanstenho...@hotmail.com Check out our apps on the App Store: BeatSpeak - the multilingual talking metronome EV-Point - Find your nearest Electric Vehicle Recharge Station. On 09/10/2013, at 4:57 AM, use-livecode-requ...@lists.runrev.com wrote: > Having some SQL query troubles... I need to get results from a long list > in a single query, BUT there are pairs of fields that must match. Every > pair is a unique pair, aka no duplicates. If my list contains 50 pair that > are unique, I may only get 30 returned rows, but I need all 50. > > This is what I've tried, but SQL strips away my outer parens, making my AND > less binding for the pair. > > WHERE > ((user = 'Joe') AND (car = 'Ford')) OR > ((user = 'John') AND (car = 'Chevy')) OR > ((user = 'Jim') AND (car = 'Kia')) OR > ((user = 'Jim') AND (car = 'Smart')) > > ~Roger _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode