2016-07-21 2 views
2

난 너비와 높이 (둘 다 정수) 테이블이 있습니다. 나는 그것을 그대로 나타내고 싶다. 예를 들어 : 폭 = 300 높이 = 160 지역 나는 다음과 같은 쿼리PostgreSQL에서 연결

select cast(concat(width,'x',height) as varchar(20)) from table; 

또는

select concat(width,'x',height) from table; 

를 사용하고 있지만 다음과 같은 오류를 얻고있다 = 300 X 160 .

ERROR: function concat(character varying, "unknown", character varying) does not exist 

Hint: No function matches the given name and argument types. You may need to add explicit type casts. 

아무에게도 어떻게 할 수 있습니까? 감사에 따라

답변

2

concat() 문자열이 아닌 정수를 기대하고있다. 그러나 오류 메시지에서와 같이 명시 적 캐스트를 사용할 수 있습니다.

select concat(width::text, 'x', height::text) 
from ...