On Fri, Oct 12, 2012 at 7:53 PM, Gary Jeurink<[email protected]> wrote:
>I'm not good at SQL statements because I'm used to using the visual tools
>but my tmID is a VARCHAR(7), So my select statement from the games table is
>something like
>
>SELECT * FROM cgms WHERE (cgms.tmID = "nebr") OR (cgms.opID = "nebr") AND
>cgms.season=2012;
>
Gary:
Operator precedence has AND higher than OR, so you need to change the
order of terms, or better yet, put parens around the sub-clauses:
... WHERE (cgms.season=2012) ;
AND ((cgms.tmID = "nebr") OR (cgms.opID = "nebr"))
As you have it, you'll get the away games for 2012 and home games for
all years.
Dan Covill
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.