Home > database >  Novice consult: oracle when the three screening of a field, data of another field
Novice consult: oracle when the three screening of a field, data of another field

Time:09-28

A table has two fields dept and time, the data is as follows:
Dept time
100 ehk9v 2017-07-26
100 smyut 2017-07-27
100 sn34t 2017-07-27
100 efllf 2017-07-29
100 u36j 2017-07-30
100 u36j 2017-07-31
100 u36j 2017-08-04
100 li18 2017-08-05
100 mt9m 2017-08-06
100 RWZK 2017-08-07
10000 kc 2017-08-07
100 sn34t 2017-08-08

How to take out the time for the 2017-08-08, 2017-08-07, 2017-08-07 dept when data

CodePudding user response:

Select deptno from t
Where crtime in (' 2017-08-08 ', '2017-08-07', '2017-08-04')

CodePudding user response:

Select deptno from t
Where time in (to_date (' 2017-08-08 ', '- dd yyyy - mm),
'to_date (' 2017-08-07', '- dd yyyy - mm),
'to_date (' 2017-08-04', '- dd yyyy - mm));
  • Related