Since some time I have been adding WHERE 1=1 to all my queries. I get queries like this: SELECT * FROM emp e WHERE 1=1 AND e.ename LIKE ‘A%’ AND e.deptno = 20 Lots of people ask me what’s the use of this WHERE 1=1.
Read moreMonthly Archives: March 2015
Numeric sorting an alphanumeric column
The other day a customer came up to me and said: I have this column that holds numeric data, usually. But when I sort it it gets all messed up, because is sorts it alphanumerically. That is 10 is listed before 2 etc. My first suggestion was: well, sort by TO_NUMBER(column) then. Well, he replied, […]
Read more