Reputation: 6733
Here i have sql server query (creating view) as shown below:
Example:
create view v1
as
select distinct
table1.col1,table1.col2,table1.col3,
table2.col1,table2.col2,table2.col3,
CONVERT(varchar, table2.col4, 106) AS newcol, /*table2.col4 is datetime type*/
from table1;
Q: How to use convert() function used above in PostgreSQL?
Upvotes: 0
Views: 6250
Reputation: 180917
Looks like you simply want TO_CHAR()
, something similar to;
select distinct
table1.col1,table1.col2,table1.col3,
table2.col1,table2.col2,table2.col3,
to_char(table2.col4, 'DD mon YYYY') AS newcol,
...
Upvotes: 1