1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

SQL Query Help

Discussion in 'Web Design & Development' started by RogueSpear00, Jan 10, 2011.

Thread Status:
Not open for further replies.
  1. RogueSpear00

    RogueSpear00 Thread Starter

    Joined:
    Jan 18, 2008
    Messages:
    472
    I wasn't sure whether to put this in Software or here, so I figured I'd start here :) I know this will be a straightforward answer from you SQL geniuses...

    I have a table, it contains contacts that I import on a daily basis. I will have an ASP.NET front end for user interaction. From this table, my intention is to send them all mailers - but only one to each address. So my end result is a user enters a date (which corresponds to teh date imported) and they are given a resultant grid that has all the unique addresses associated to that date. I only want to send a mailer to that address once - many times my original imported list will contain multiple businesses at the same address.

    Table: ContactTable
    Fielsd:
    ID, CompanyName, Address, City, State, Zip, Phone

    I can use the SELECT DISTINCT clause, but I need all the data associated to it (company name, etc.)

    I have over 262000 Records in this table.

    If I select a sample date of 1/10/2011, I get 2401 records. SELECT DISTINCT Address from the same date gives me 2092 records. This is workable, I would send those 2092 people a mailer.

    Secondly, I'd have to be able to historically check if a mailer was already sent to that address as well. I would not want to send another mailer to the same business tomorrow either.

    What's my best way?
     
  2. RogueSpear00

    RogueSpear00 Thread Starter

    Joined:
    Jan 18, 2008
    Messages:
    472
    Bleh, Moderator can you move this to Software Development please... I should have put it in there in the first place....
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/973859

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice