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: Indexes
How to Quickly Enumerate Indexes in Oracle 11gR2
Do you want to know real quick what kind of indexes there are on any given table in your Oracle schema? Nothing simpler than that. Just run the following query: SELECT i.index_name, listagg(c.column_name, ', ') WITHIN GROUP (ORDER BY c.column_position) AS columns FROM all_indexes i JOIN all_ind_columns c ON i.index_name = c.index_name WHERE i.table_name = … Continue reading How to Quickly Enumerate Indexes in Oracle 11gR2