ERROR: function pg_catalog.substring(timestamp without time zone, integer, integer) does not exist
LINE 1: SELECT u.username,l.description,l.ip,SUBSTRING(l.createdate,…
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

日期数据类型的“substring”并没有很好的定义,因为它取决于数据的外部格式。 在大多数情况下,应该使用extract()或to_char()函数。 通常对于要返回的数据,需要to_char(),并对其进行操作(包括比较) - extract()。有些情况下,这条通用规则不适用,但这些通常是数据结构不是很好的标志。 例:

# select to_char( now(), 'YYYY-MM-DD');
  to_char
------------
 2020-08-06
(1 row)

对于提取,让我们编写一个简单的查询,列出晚上8点后创建的所有对象:

select * from objects where extract(hour from created) >= 20;
EXTRACT()("提取"的意思)

函数用于返回日期/时间的单独部分,比如年、月、日、小时、分钟等等。

就是返回出来具体的年,月,日

二、如果您使用Postgresql,您将收到:
select('SUBSTRING(offer.date_closed, 0, 11)')
function substr(timestamp without time zone integer integer) does not exist

使用:

select('SUBSTRING(CONCAT(offer.date_closed, \'\'), 0, 11)')
concat()函数

1、功能:将多个字符串连接成一个字符串。

2、语法:concat(str1, str2,…)

返回结果为连接参数产生的字符串,如果有任何一个参数为null,则返回值为null。

3、举例:

例1:select concat (id, name, score) as info from tt2;