mysql - SQL syntax exception -
mysql - SQL syntax exception -
i beginner mysql , want find out why getting sql syntax exception below query:
select a.file_id file_xfer_tracking_detail a, file_xfer_tracking_header b b.transaction_id = a.transaction_id , b.interface_id =? , a.file_name =? , a.status = 'inprocess' , a.update_time > sysdate- 0.003472222222222222 , a.file_id <> ? , b.direction = ? in mysql workbench, in editor see syntax error @ and b.interface_id=? . beginner , not sure how prepare it,
also, reference bareword sysdate valid syntax oracle, it's invalid mysql.
in mysql, homecoming current datetime, you'd want reference function sysdate(), or function now().
subtracting numeric value date look valid in oracle; it's not valid in mysql.
the particular numeric value specified in query (0.003472222222222222) interpreted oracle fractional part of day, equivalent 5 minutes. ( = 1/24/60 * 5 )
in mysql, equivalent, you'd want like:
now() + interval -5 min also, ditch old-school comma syntax bring together operation, , utilize join keyword instead, , relocate bring together predicates where clause on clause. (the comma bring together operator still valid syntax, it's outdated , improved syntax has been available long time.)
file_xfer_tracking_detail bring together file_xfer_tracking_header b on b.transaction_id = a.transaction_id ... mysql sql
Comments
Post a Comment