Hello
I was wondering if someone could help me out with something.
With the following rows:
agnt_num supv_num meet_num strt_dt strt_lvl trm_dt trm_lvl
1 1 1 10-10-2000 01 10-15-2000 02
1 1 2 10-09-2000 06 05
1 2 1 10-08-2000 05 10-20-2000 01
1 2 1 10-05-2000 01 10-15-2000 03
What I need is SQL to get one row per agnt/supv with the following:
strt_dt, strt_lvl of earliest strt_dt
trm_dt, trm_lvl of the latest trm_dt but only if all trm_dts for
the supv are
filled in, otherwise null for both
agnt_num supv_num strt_dt strt_lvl trm_dt trm_lvl
1 1 10-09-2000 06 null null
1 2 10-05-2000 01 10-20-2000 01
If anyone has any ideas on the most efficient way to accomplish this,
I'd appreciate a reply.
Thanks!
I was wondering if someone could help me out with something.
With the following rows:
agnt_num supv_num meet_num strt_dt strt_lvl trm_dt trm_lvl
1 1 1 10-10-2000 01 10-15-2000 02
1 1 2 10-09-2000 06 05
1 2 1 10-08-2000 05 10-20-2000 01
1 2 1 10-05-2000 01 10-15-2000 03
What I need is SQL to get one row per agnt/supv with the following:
strt_dt, strt_lvl of earliest strt_dt
trm_dt, trm_lvl of the latest trm_dt but only if all trm_dts for
the supv are
filled in, otherwise null for both
agnt_num supv_num strt_dt strt_lvl trm_dt trm_lvl
1 1 10-09-2000 06 null null
1 2 10-05-2000 01 10-20-2000 01
If anyone has any ideas on the most efficient way to accomplish this,
I'd appreciate a reply.
Thanks!
Comment