Home > database >  Newcomer consult SQL problem, hope your bosses give directions, thank you
Newcomer consult SQL problem, hope your bosses give directions, thank you

Time:09-16

The SQL statement is:
Select * from cxhnweixin. FPV_FARM_PAY_VOUCHER
Where the status='finish'
And to_char (finish_time, '- dd yyyy - MM) & gt;=to_char (to_date (' ${starttime} ', '- dd yyyy - MM))
And to_char (finish_time, '- dd yyyy - MM) & lt; To_char (to_date (' ${endtime} ', '- dd yyyy - MM))
Database without brush to select data for blank, including database format for 2020-01-01 00:00:00. 0 style, is this statement, where there is a problem, how to change things, thank you

CodePudding user response:

The conditions of the two time conflict?
Advice to time were compared

CodePudding user response:

Have resolved the
Select * from cxhnweixin. FPV_FARM_PAY_VOUCHER
Where the status='finish'
And finish_time & gt;=cast (to_date (' ${starttime} ', '- dd yyyy - mm hh24: mi: ss') as timestamp)
And finish_time & lt; Cast (to_date (' ${endtime} ', '- dd yyyy - mm hh24: mi: ss') as timestamp)
The order by finish_time
  • Related