I would be surprised if UNION ALL gives better performance than a simple "OR" query, since it's effectively 2 queries and a merge, but some EXPLAIN analysis could confirm.
The '?' on what was supposed to be raw SQL threw me too. But I think I recall that using ? with LIKE-style operations gave me problems. Like whether to put the '%' on the SQL or in the value to be substituted.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
For example, particularly in this case speakerid5 and lisenerid5 are grouped by appointmentid which it is also 5 in my mock database. So the undesired result I am gettting is two rows (one comin from each select) instad of just the newest one.
I prefer to focus on the impossible, because about the possible we already know too much.
Code without tests simply doesn’t exist!
Code is how we tell our colleagues how we feel about them.