FROM email_results
The idea is that email and product combined should be unique. Besides this,
My suggestion is to either write a trigger to make sure that duplicate data
does not get inserted in future or run a query from time to time which
selects duplicate records and deletes them coz It is not good to have
useless data in the database.
Thanks,
Milan Mushran
>From: Jochem van Dieten <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: Re: Stuck on Query
>Date: Tue, 25 Nov 2003 21:56:25 +0100
>
>Ben Densmore wrote:
>
> > I thought I had figured out a way to display some info but then realized
> > that I was missing something. I have a table called email_results that
> > keeps track of products that users click on from an email they received.
> >
> >
> > In this table I have a unique ID that matches them up to their email
> > address and company name that is stored in another table called
> > email_blast.
> >
> > If a person clicks on the same product twice a new row is added to the
> > email_results table that includes identical data. When displaying the
> > data if the same person clicked on a product more than once I only want
> > to show it one time, if that same person clicked on 2 separate products
> > I want to show each product they clicked on.
> >
> > I thought by grouping by email address that I fixed the problem but then
> > noticed it will only show them as clicking on one product even if they
> > clicked on 2 different products.
>
>SELECT DISTINCT *
>FROM email_results NATURAL JOIN email_blast
>
>Jochem
>
>--
>Who needs virtual reality
>if you can just dream?
> - Loesje
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

