Database ( DB )/Database

postgresql에서 insert하고 id 리턴받기

노루아부지 2019. 7. 23. 23:59

INSERT INTO Table1 (name) VALUES ('a_title') RETURNING id 

 

위와 같이 RETURNING을 붙여준다. 

 

출처 : http://stackoverflow.com/questions/6560447/can-i-use-return-value-of-insert-returning-in-another-insert

728x90

'Database ( DB ) > Database' 카테고리의 다른 글

postgresql 에러 로그 확인  (0) 2019.08.04
Postgresql 설치 에러날 때  (0) 2019.08.04
PostgreSQL install  (0) 2019.08.04
[openBSD] oracle thin test  (0) 2019.07.31
CentOS - MySQL install  (0) 2019.07.21
loading