In SQL, quite often, we want to compare several values with each other. For instance, when we're looking for a specific user by their first and last names, we'll write a query like this one: SELECT * FROM customer WHERE first_name = 'SUSAN' AND last_name = 'WILSON'; We're getting: CUSTOMER_ID FIRST_NAME LAST_NAME ------------------------------------ 8 SUSAN … Continue reading Don’t Use the String Concatenation “Trick” in SQL Predicates
Tag: predicates
Why PostgreSQL is so Awesome
Just recently, I've blogged about PostgreSQL 9.3 having been released, which is awesome enough as PostgreSQL finally supports materialised views and updatable views. I have then blogged about PostgreSQL's syntax being a mystery only exceeded by its power, as it allows for treating INSERT and UPDATE statements as table references, when used with the RETURNING … Continue reading Why PostgreSQL is so Awesome
SQL Query Transformation Fun: Predicates with Row Value Expressions
Recently, I've blogged about how well jOOQ's supported databases implement row value expressions and predicates formed from them. Some sample articles: Row value expressions and the BETWEEN predicate Row value expressions and the NULL predicate A Typesafety Comparison of SQL Access APIs Row value expressions (or records, tuples) are useful to express more complex predicates, such as this … Continue reading SQL Query Transformation Fun: Predicates with Row Value Expressions