Legitimate Uses of the Antipattern
A well-justified use of wildcards is in ad hoc SQL when you’re writing quick queries to test a solution or as a diagnostic check of current data. A single-use query benefits less from maintainability.
The examples in this book use wildcards to save space and to avoid distracting from the more interesting parts of the example queries. I rarely use SQL wildcards in production application code.
If your application needs to run a query that adapts when columns are added, dropped, renamed, or repositioned, you may find it best to use wildcards. Be sure to plan for the extra work it takes to troubleshoot the pitfalls.
You can use wildcards for each table individually in a join query. Prefix the wildcard with ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access