SQL Implicit Cast of Character Strings and Numeric Values
June 22, 2011 Skip Marchesani
Awhile back I was teaching an SQL class in Fargo, North Dakota. During one of the afternoon lab sessions, one of the students asked if he could use the CONCAT function on two numbers, or two numeric columns, without first casting them to character values. I knew the answer was “No”, and that the numeric values had to be cast to character first before the student concatenated them together. Instead of just giving the student the answer, I played good teacher and I told the student to try it and let me know how it worked. Imaging my surprise when |