我正在尝试使用它的RIGHT()
功能,因此它只会显示从客户表中提取的信用卡号的最后 4 位数字。这是我到目前为止所拥有的:
create function get_customer(text) returns setof cusinfo as
$$
select upper(first_name)||' '||upper(last_name) as full_name, upper(address), upper(city)||', '||upper(state)||' '||zip as citystatezip, email, '************'||right(cc_number,4), cc_name
from customer
where customer_id = $1;
$$ language sql;
我得到的错误是:
psql:finalproject.sql:273:错误:函数正确(文本,整数)不存在第 3 行:...|' '||zip as citystatezip, email, ' * ** * '||right(cc_n...
关于为什么会发生这种情况的任何想法?我尝试只单独使用RIGHT()
并放入类似的东西RIGHT('Help me', 2)
,但我得到了同样的错误。