我对postgres仍然陌生。我想在查询的SELECT部分有一个SELECT语句,但现在我得到一个错误。SELECT子查询PostgreSQL
SELECT cu.user_name, cu.created_date, cu.updated_date, cu.email_address,
cua.attribute_name, cua.attribute_value,
(select to_char(to_timestamp(cua.attribute_value/1000), 'yyyy-mm-dd HH24:MI:SS')) AS Issue_Update
FROM cwd_user cu
INNER JOIN cwd_user_attribute cua ON cu.id = cua.user_id
WHERE cu.user_name LIKE 'perter%'
我收到以下错误:
ERROR: operator does not exist: character varying/integer LINE 3: (select to_char(to_timestamp(cua.attribute_value/1000), '... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
不能分割与性格int ... –
@a_horse_with_no_name有没有办法在分割之前将其更改为整数? – kya
cast(cua.attribute_value as integer) –