cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC SQL Query

Former Member
0 Kudos

Hi Gurus,

I have a question regarding Query and update SQL statement. I have a field in the DB named XXX_date. I need to get the record where the last query ended. Is this possible? For example, my last query was yesterday at 2pm. I want to get the records from today until 2:01pm of yesterday.

Thanks!!!

Accepted Solutions (1)

Accepted Solutions (1)

former_member472138
Active Contributor
0 Kudos

select empid, name, max(XXX_date) XXX_date from group by id,year

Juss check this out.

Former Member
0 Kudos

hi pothana,

i don't need a where statement?

select XXX, YYY, ZZZ from XXX_table where XXX_date = ?

how can i code it in such a way that only the latest records are read.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use functions between and to_date combination to achive this.

Select  XXX, YYY, ZZZ from XXX_table  Where XXX_date between to_date('05-31-2011 12:15','MM-DD-YYYY HH:MI')

 and  to_date('06-01-2011 12:15','MM-DD-YYYY HH:MI')

Hope that helps.

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

You can do that easily i think

Last updated record date value is going to have maximum, you can try with max , but i feel this is not good idea.

google it...you will find solution.

Regards,

Raj