mysql의 right 함수를 postgresql로 수정을 하면 어떻게 되나요?
mysql의 예
select right(sub,1) from test where id=1
postgresql의 예
select right(sub,1) from test where id=1를 그냥 사용은 안하는것 같거든요
right대신 rtrim을 사용하나요, 아님 rpad를 사용하나요
right를 사용했을 때의 에러메세지 입니다.
Warning: PostgreSQL query failed: ERROR: Function 'right(varchar, int4)' does not exist Unable to identify a function that satisfies the given argument types You may need to add explicit typecasts in /usr/local/apache/htdocs/test/pgsql/process.php on line 84
필드 타입은 varchar(n)으로 되어 있습니다.
답변 부탁드립니다.
결과가 이상하게 들어가네요
|