php - Instruction conditional if to checked double records -
this question has answer here:
- check if row exists mysql 3 answers
how can write instruction if
, check records stored @ same time (in table column created_at
). example:
if(created_at record key(it's column)='stan' same created_at key='stan_key' { return records key='stan' }
several options this. here's version using exists
:
select * yourtable y1 y1.key = 'stan' , exists ( select 1 yourtable y2 y2.key = 'stan_key' , y1.created_at = y2.created_at)
Comments
Post a Comment