Cute Happy Ghost
본문 바로가기
DB/Postgresql

[postgresql] case when true false 조건에 따라 출력하는법, 중복방지 글쓰기

by JENN_tech7 2021. 11. 15.
728x90
SMALL

where 절에 있는 조건의 애들이 맞는 데이터들이 0개면 false

아니면 true

ajax를 써서 false면 글을 쓸 수 있게

true면 글작성이 안되게

 select 
 	CASE WHEN count(*) = 0 THEN false ELSE true END 
 from t_record_amt_life_rcy 
 where sgg_cd = #{sgg} and fclt_year =#{fclt_year}

 

728x90
LIST

댓글