Thanks, that did it!
> -Original Message-
> From: Peter Brawley [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2008 11:57 AM
> To: Jeff Mckeon
> Cc: mysql@lists.mysql.com
> Subject: Re: delete query question
>
> Jeff,
>
> >Table2.ticket = t
Jeff,
Table2.ticket = table1.ID
Table2 is a many to 1 relationship to table1
I need to delete all records from table1 where created <
unix_timestamp(date_sub(now(), interval 3 month))
And all rows from table2 where Table2.ticket = Table1.ID
(of the deleted rows..)
Like this (untested)?
DELE
> Sent: Tuesday, July 08, 2008 11:27 AM
> > To: Jeff Mckeon
> > Cc: mysql@lists.mysql.com
> > Subject: Re: delete query question
> >
> > If the tables are InnoDB, you could temporarily set up a foreign key
> > relationship between the two, with the 'ON D
> -Original Message-
> From: Ian Simpson [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2008 11:27 AM
> To: Jeff Mckeon
> Cc: mysql@lists.mysql.com
> Subject: Re: delete query question
>
> If the tables are InnoDB, you could temporarily set up a foreign ke
If the tables are InnoDB, you could temporarily set up a foreign key
relationship between the two, with the 'ON DELETE CASCADE' option.
On Tue, 2008-07-08 at 11:14 -0400, Jeff Mckeon wrote:
> I think this is possible but I'm having a total brain fart as to how to
> construct the query..
>
> Tabl
I think this is possible but I'm having a total brain fart as to how to
construct the query..
Table2.ticket = table1.ID
Table2 is a many to 1 relationship to table1
I need to delete all records from table1 where created <
unix_timestamp(date_sub(now(), interval 3 month))
And all rows from table
;
(note the change in case is just my way of seeing things.. it's not
necessary that I know of)
- Original Message -
From: "Olaf Stein" <[EMAIL PROTECTED]>
To: "MySql"
Sent: Wednesday, September 05, 2007 9:35 AM
Subject: Delete query question
Hey
at you're deleting first.. then if that is good. do
>>>
>>>
>>> DELETE FROM geno_260k WHERE ident IN (SELECT ident FROM geno_260k WHERE
>>> a1=0
>>> GROUP BY ident HAVING count(a1)>25);
>>>
>>> (note the change in case
things.. it's not
> necessary that I know of)
>
>
> - Original Message -
> From: "Olaf Stein" <[EMAIL PROTECTED]>
> To: "MySql"
> Sent: Wednesday, September 05, 2007 9:35 AM
> Subject: Delete query question
>
>
>> Hey all
reply inline
On 9/5/07, Olaf Stein <[EMAIL PROTECTED]> wrote:
>
> delete from geno_260k where ident=(select ident from geno_260k where a1=0
> group by ident having count(a1)>25);
When a sub query returns more than one row in a where clause, then "="
should be replaced by the "in" .
--
Th
Perhaps not the most elegant way:
- Create a temporary table
- Select-insert into the temp-table
- Use the temp-table for a delete-join or a 'NOT IN'-statement or something
like that
Hey all
I am stuck here (thinking wise) and need some ideas:
I
GROUP BY ident HAVING count(a1)>25);
(note the change in case is just my way of seeing things.. it's not
necessary that I know of)
- Original Message -
From: "Olaf Stein" <[EMAIL PROTECTED]>
To: "MySql"
Sent: Wednesday, September 05, 2007 9:35 AM
Su
Hey all
I am stuck here (thinking wise) and need some ideas:
I have this table:
CREATE TABLE `geno_260k` (
`genotype_id` int(10) unsigned NOT NULL auto_increment,
`ident` int(10) unsigned NOT NULL,
`marker_id` int(10) unsigned NOT NULL,
`a1` tinyint(3) unsigned NOT NULL,
`a2` tinyint(3
Edwards,
Friday, February 22, 2002, 12:58:23 PM, you wrote:
Eeoen> Hope somebody can help me on this one
Eeoen> At present I have two tables in my database. The data in question is built
Eeoen> around credit card transactions.
Eeoen> Tables Structure
Eeoen> Headers Table
Eeoen> ID (Prima
Hope somebody can help me on this one
At present I have two tables in my database. The data in question is built
around credit card transactions.
Tables Structure
Headers Table
ID (Primary Key used by the TRANSACTIONID field in the Transaction table)
HEADERDETAILS blah, blah
Transaction
15 matches
Mail list logo