Questions tagged [precedence]

The order in which things are executed or evaluated.

In SQL logical conditionals have precedence. For instance, AND has a higher binding precedence than OR. In some RDBMes operators can be assigned a custom precedence too.

3 questions
3
votes
3 answers

Query result precedence if filter columns have values

I have a table "customer_config" with these columns: company (varchar) warehouse (numeric) section (numeric) config_keyword (varchar) config_value (varchar) The two config_* columns can apply to an entire company (warehouse and section are null),…
2
votes
1 answer

Why does this query return users not born on the date provided?

I am trying to search for a client using name and date of birth. My query is included below. Select * From Client Inner Join Address On Client.num = Address.cl_num Where Client.fname LIKE ‘%john%’ and Client.sname LIKE ‘%doe%’ Or …
Courtney
  • 133
  • 4
0
votes
1 answer

SQL order of precedence

Given a query ending in where a and b and c or d, will this behave as where (a and b and c) or d, or where a and b and (c or d)? (Or something else?) I've read the docs and they seem to suggest it would be the former as and has a higher precedence…
cb7
  • 135
  • 1
  • 3