Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to use group function in insert or update

Srikkanth.MMar 1 2010 — edited Mar 2 2010
Hai All

How can we use group function in insert or update statement

I am generating an attendance so i have different set of timing for example

0800,1200,1230, 1700 and i need to insert into these data into table with min value to intime and max value to

outtime and othere to inertval time in or out

Pls tell me with some example


For example

For INSERT

insert into T2 (barcode,empcode,intime,attend_date)
values(r2.cardn,r2.enpno,MIN(r2.ptime),r2.pdate);


For UPDATE

update dail_att set outtime= MAX(r2.ptime) where empcode=r2.enpno and barcode=r2.cardn and
attend_date=r2.pdate;


Here instead of where i need to use having so pls tell how to use

Thanks & Regards

Srikkanth.M
This post has been answered by 750704 on Mar 2 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 30 2010
Added on Mar 1 2010
4 comments
1,205 views