Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Query problem

Re: Query problem

From: Ryan Novak <ryan_nospam_at_nospam.novak.net>
Date: 2000/04/04
Message-ID: <XtrG4.34724$MZ2.451528@news1.wwck1.ri.home.com>#1/1

Yes, I know about DISTINCT.

The way this program is set up is stupid in my opinion and there are more logical solutions to the way the last programmer handled it. However for example, I need to get the last record on the many side to have the most recent record. The problem is that the person who created this program was not a programmer but a hack who didn't know what he was doing when it came to programming and database design.

Well, I supposed I can just use ADO to populate some of the fields in this report instead of having the data inside the recordset.

---Ryan

"Shawn Clark" <shawnx.d.clark_at_intel.com> wrote in message news:8cdf4e$8j3_at_news.or.intel.com...
> Ryan,
>
> As long as you are only selecting columns from the "one" side then add
> DISTINCT and you should only get one row. If you are selecting columns
 from
> both tables then I don't see why you would only want one row returned.
>
> Shawn Clark
> Meridian Technology Group
>
> "Ryan Novak" <ryan_nospam_at_nospam.novak.net> wrote in message
> news:4dqG4.34262$MZ2.451051_at_news1.wwck1.ri.home.com...
> > Ok, I have two tables that have a one-to-many relationship.
> >
> > I want to merge both these tables into a single view. No problem.
> >
> > Now here is where my problem begins. Let's say that this view returns
 two
> > records caused by the one-to-many relationship. Each record is unique
> > because of the "many" side. How do I get it to return one row? For
> > example, I just wanted to get the most recent data from the "many" side.
> >
> > I am using MSSQL 7.0 as a backend. I can do this in a query in Access,
 but
> > haven't been able to figure out how to do it in SQL.
> >
> > ---Ryan
> >
> >
> >
> >
>
>
Received on Tue Apr 04 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US