Format query output from a
selectstatement.For an overview see page Miscellaneous SQL Functions
Prototype
format( fmt, val);Arguments
fmt The format string val The value to be formatted Description
This function formats the value
valaccording to the format specified by the format stringfmt. If val is of typedatetime, thenfmtmust be a string suitable forstrftime(). For numeric and string valuesfmtmust be a string suitable forprintf(). Values of other types are converted to string. (Note that the format string must be enclosed in single quotes.)Example
create table t(c char); insert into t(c) values('comment'); select c, format('A parenthetic (%s :)', c) from t; c #2 ----------------------------------------------------- comment (A parenthetic comment :)