Your query selects eight fields. Your Display shows five fields. The distinct verb
works on all eight fields and
apparently some of the fields not displayed are different. Limit the query for the
display to the five fields displayed
and the distinct verb should eliminate the duplicates from the display. You may
need to  keep your current query
as it is for the editing purposes that you stated but if you use this query for the
display it will continue to show the duplicates.

Chris Toth wrote:

> I rearranged the query a little: SELECT DISTINCT request.id AS requestid,
> request.date, request.type, request.status,
> faculty.f_name, faculty.l_name, action.id AS actionid, faculty.id AS
> facultyid FROM faculty, request, action WHERE request.id=action.request_id
> AND request.requested_by=faculty.id AND request.status=2;
>
> And it still does the same thing. I rechecked all the fields that I am
> querying and I do need all of them. Because I need to match the actions to
> the request(request.id=action.request_id), the requests to the faculty
> member who submitted the request(request.requested_by=faculty.id) and make
> sure I am only retrieving requests that are being worked on(request.status=2)
>
> I know it sounds complicated, but this is the only way I can think of to
> get the data I need.
>
> Thanks,
> Chris
>
> At 09:49 AM 3/7/2001 -0700, you wrote:
> >It looks like the addition of the distinct verb should do the job if in
> >fact your
> >query only showed the fields on the display.
> > >From your Sql however you are selecting more fields than are displayed
> > and some
> >of those are different which distinct
> >will still display.
> >
> >Chris Toth wrote:
> >
> > > Ok, I've been battling this SELECT statement for the better part of the
> > day.
> > >
> > > The SELECT statement is this:
> > >
> > > SELECT DISTINCT request.id AS requestid, request.date, request.type,
> > > request.status,
> > > faculty.f_name, faculty.l_name, action.id AS actionid, faculty.id AS
> > > facultyid FROM faculty, request, action WHERE request.id=action.request_id
> > > AND request.requested_by=faculty.id AND request.status=0;
> > >
> > > And the results are here:
> > >
> > > http://www.geology.ohio-state.edu/test/rfatest/rfaadmin.php?closed=Closed
> > >
> > > Now, if you look at the table, at the far left cell under RFA#, you'll
> > > notice that they are all the same (2). That is because there were 4 actions
> > > performed on RFA # 2. However, I only need for the column to be displayed
> > > once. When the user clicks under 'last action' then they can see all 4
> > > actions. But for this table, I just need to show the data once.
> > >
> > > So, could any kind soul help me out?
> > >
> > > Thanks
> > >
> > > ---------------------------------------------------------------------
> > > Before posting, please check:
> > >    http://www.mysql.com/manual.php   (the manual)
> > >    http://lists.mysql.com/           (the list archive)
> > >
> > > To request this thread, e-mail <[EMAIL PROTECTED]>
> > > To unsubscribe, e-mail
> > <[EMAIL PROTECTED]>
> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to