select table1.books from table1, table2 where table1.books != table2.books
Curtis
On Tue, 13 May 2003, Bruce Douglas wrote:
> Bruce...
>
> Thanks for the response.. Someone else had suggested the same thing!! it
> solved the issue... however, i have another quick question that i thought i
> had solved... i have two tables. both have a field "books"
>
> table1
> name
> books
>
> table2
> dogs
> books
>
> i'm trying to come up with a quick query that will let me get all the rows
> in table1 that don't have books matching in table2
>
> in other words... table1 books (sam, foo, duck, shoe)
> table2 books (sam, foo)
>
> my query would return (duck, shoe)
>
> i thought i had it.. but testing proved me wrong...
>
> select openassettbl.assetid, assetname, description from openassettbl,
> selectiontbl where
> openassettbl.assetid != selectiontbl.assetid
>
> this seems to have given me everything!!!
>
>
> thanks
>
> bruce
> bedouglas@stripped
>
>
> -----Original Message-----
> From: Bruce Feist [mailto:bfeist@stripped]
> Sent: Tuesday, May 13, 2003 3:16 PM
> To: Bruce Douglas; mysql@stripped
> Subject: Re: a database design question....
>
>
> Bruce Douglas wrote:
>
> >table foo
> > uid
> > store
> > asset
> >
> > uid store asset
> > 3 tom book
> > 3 tom table
> > etc....
> >
> >so i can have duplicates in any of the columns.... i just can't have a row
> >where all of the columns are already in the table.
> >
> Create a single unique index (or primary key) on all three fields.
>
> Bruce Feist
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>
>
--
--
Curtis Maurand
mailto:curtis@stripped
http://www.maurand.com