[Cialug] OT: SQL Help?

jim kraai jimgkraai at gmail.com
Wed Oct 2 13:58:51 CDT 2013


select Fname, Lname, StreetAddress
from SampleTable
group by StreetAddress;



On Wed, Oct 2, 2013 at 1:45 PM, Nathan C. Smith <NSmith at hhlawpc.com> wrote:

>
> Hello SQL Gurus.
>
> I am trying to do a quick and dirty operation on a mailing list somebody
> provided to me in Excel.  What I want to do is reduce the list so that only
> one is sent to each household to save paper and postage.  The list is
> something like this:
> SampleTable
> Fname   Lname   StreetAddress
> Joe     Public          801 Towanda Drive
> Mary    Public  801 Towanda Drive
> Joe Jr. Public  801 Towanda Drive
> Peter   Brady   1401 Decker
> Mr.     Rogers  1024 bitwise Ave.
> You get the idea.
>
> I was just trying to use the tools at hand - MS Excel and msquery.  So I
> set the Excel Table up as a datasource in ODBC.
>
> My plan was to do an outer join - using subqueries- one subquery with
>
> select distinct streetaddress from SampleTable
> and the other with
> select * from SampleTable
>
> With the Join on StreetAddress
>
> My understanding was if I used an outer join, using my table (in this
> example) only 3 address records as the required table and the whole table I
> would only get 3 items in my table.  The query gives results, but I get the
> whole table again (all 5 records) and it does not seem to be working like I
> expect.
>
> Does anyone else have any thoughts on how I might attack this problem?
>  Keep in mind there are a lot of limitations using JET and msquery.  The
> table does have an ID field to make each row unique.
>


More information about the Cialug mailing list