Sql ( I think i am almost there)

0 pts.
Tags:
Oracle
SQL
after selecting all of my columns i joined the tables as follows FROM EMPL B, HB_EMPL_PKG_ELEC D, HB_EMPL_DEP_BNFIC A, HB_EMPL_MED_DEP C WHERE B.EMPL_ID = A.EMPL_ID(+) AND C.EMPL_ID = A.EMPL_ID AND C.BEN_PLAN_CD IN ('UHCALL','UHCBASIC') AND B.EMPL_ID = D.EMPL_ID(+) AND D.BEN_PLAN_CD IN('UHCALL','UHCBASIC') AND B.S_EMPL_STATUS_CD='ACT'; and i am duplicating the employee file, for example; v1.20abcdef 1800123456689 lastname1 firstname... v1.20abcdef 00123456789 dep1lastname... v1.20abcdef 1800123456789 lastname1 firstname... v1.20abcdef 00123456789 dep2lastname... If the employee has 3 dependents then its bringing back the employee file 3 times with its dependent underneath. I just need the employee file once and dependents under. Tables a Dependents tables b Employee tables c Dependent Elections tables d Employee Elections
ASKED: June 15, 2005  7:41 AM
UPDATED: June 15, 2005  9:14 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you’re still working in SQL*Plus, then use ther BREAK ON syntax to get something like:

Emp Emp_Plan Dep Dep_Plan
—– ——– —- ———-
empl1 beninfo dep1 depbeninfo
dep2 depbeninfo
dep3 depbeninfo

empl2 beninfo depa depbeninfo
depb depbeninfo
depc depbeninfo

You’ll need something like:
BREAK ON Emp, Emp_plan SKIP 1

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following