Results 1 to 4 of 4

Thread: querry problem

  1. #1
    Join Date
    Dec 2002
    Posts
    2

    Question Unanswered: querry problem

    Hi,

    This are the tables needed for my querry:

    gi_eevent
    -------------
    projid clientid name
    106 2 test2
    107 3 test3

    projemployee
    -----------------
    projid empid function
    106 1 mm
    106 2 sm
    106 3 cc
    106 4 cl
    107 5 mm

    employee
    ------------
    fname lname empid
    ennio frais 1
    jan vlas 2
    sofie dries 3
    kris kans 4
    ellen bies 5

    Now I want to display each project, but the problem is when I use the following querry (see at the bottom) it displays projid with number 106,n 4 times.
    What I want is, only once the projid (106) and then the 4 functions of the employees linked to it.

    Can anybody help?
    Thx


    Querry:
    SELECT e.projid, e.clientid, e.projname, e.entrydate, e.enddate, e.orderconfirdate, e.kickoffdate, e.reldatspecs, e.ponum, e.fixfee,
    floor(sysdate-e.entrydate) timespent, e.timebudget, e.bestprice, e.salescountry, e.oppcountry, e.teamid, e.invoicenum, e.commodity, e.reservedprice, e.varfee, e.varcost, e.invoiceorigin, e.initialvol, e.tenddescr,
    c.companyname, c.contactperslname,
    em.empfname || ' ' || em.emplname name
    FROM gi_eevent e, client c, employee em, projemployee p
    WHERE e.clientid = c.clientid AND e.projid = p.projid
    AND p.empid = em.empid;

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: querry problem

    What do you want the output to look like? And how are you running this query - in SQL Plus, or some other tool?

    In SQL Plus you can suppress the repeated values like this:

    BREAK ON proj_id ON clientid ...etc.

    SELECT proj_id, clientid, empid....
    ...
    ORDER BY proj_id, clienid, empid...;

  3. #3
    Join Date
    Dec 2002
    Posts
    2

    Re: querry problem

    I'm working with an oracle db and java servlet pages to display the result of the querries.

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: querry problem

    Originally posted by karlitos
    I'm working with an oracle db and java servlet pages to display the result of the querries.
    In that case I would say it is down to your JSP code to suppress reprinting the project details.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •