I wish!

That's the first thing that occurred to me ... unfortunately, this must be done 
by query ... I'm not allowed to create tables <sigh />.  Seems the guy I'm 
doin' this for doesn't trust me that far ... he got burned pretty badly a few 
years ago by a developer building in back-door access to his stuff, so he's 
leery of allowing any more access than absolutely necessary ... can't say I 
blame him, considering what it cost him.

Anyway, temp table is out ... not sure about flat file, but that's pretty 
kludgy ... SQL would be more elegant and probably simpler - if I can ever get 
it to work <chortle />.

Make a good day ...
                               ... barn

> Create a temporary table from the files table delete records where  attribute 
> in temp table exists in the attribute table (26 - 30) delete statements.
> What remains after all DELETEs are those files with no existing attribute.

> HTH & YMMV


> On 3/25/06, barney <[EMAIL PROTECTED]> wrote:
> Folk,

> This may be off-base for this list, but I've run out of places to look, 
> sorry.  I can't seem to find this anywhere, although I'm certain I've seen it 
> before.

> How can I identify all the records in a table that are not referenced in a 
> many-to-many table?

> I have a [unique] table of files and a [unique] table of attributes.  These 
> are linked in a merge table which is many-to-many.  I need to find all items 
> in the file table that are not referenced in the merge table in order to add 
> appropriate attributes for those records.  The attribute list is 26-30 
> records and the file table is currently about 3,200 records, which could make 
> for a merge table of 96,000 records.

> I tried using an IN statement against a sub-select of unique file ids in the 
> merge table, but either that will not work or I did not craft it 
> properly  The query hit 6 million records before I aborted it <sigh />.

> I'm certain this can be done ... I seem to remember a similar process from 
> the DB2 corporate days ... but I just cannot wrap my head around it.  Anybody 
> have any ideas, please?

> Make a good day ...
>                                   ... barn




> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:     http://lists.mysql.com/[EMAIL PROTECTED]

>
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to