From: "Ryan Novak" <ryan_nospam@nospam.novak.net>
Subject: Re: Query problem
Date: 2000/04/04
Message-ID: <XtrG4.34724$MZ2.451528@news1.wwck1.ri.home.com>#1/1
References: <4dqG4.34262$MZ2.451051@news1.wwck1.ri.home.com> <8cdf4e$8j3@news.or.intel.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Complaints-To: abuse@home.net
X-Trace: news1.wwck1.ri.home.com 954876919 24.14.198.134 (Tue, 04 Apr 2000 12:35:19 PDT)
Organization: @Home Network
X-MSMail-Priority: Normal
NNTP-Posting-Date: Tue, 04 Apr 2000 12:35:19 PDT
Newsgroups: comp.databases.ms-sqlserver


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@intel.com> wrote in message
news:8cdf4e$8j3@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@nospam.novak.net> wrote in message
> news:4dqG4.34262$MZ2.451051@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
> >
> >
> >
> >
>
>




