mysql/os stuck

2008-07-08 Thread Marco mangione
Hello, i have a strange problems appeared 2 week ago'. During the night with no apparently strange task mysql hang and if i try to do some query i have as result: 1) big timeout... or directly no response 2) ERROR 1018 (HY000): Can't read dir of '.' (errno: 24) to fix the problem i have to reboot

Re: Joining a table to itself

2008-07-08 Thread Phil
I think you have just got your table names confused. Try this one SELECT cats.CatId, cats.cat As cat, cats1.catid AS catid1, cats1.cat As cat1, cats2.catid AS catid2, cats2.cat AS cat2, cats3.catid AS catid3, cats3.cat AS cat3 FROM vb_ldcats as cats LEFT JOIN vb_ldcats As cats1

RE: Joining a table to itself

2008-07-08 Thread Jim MacDiarmid
Thanks Shannon. :) -Original Message- From: Shannon Wade [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2008 4:04 PM To: Jim MacDiarmid Subject: Re: Joining a table to itself not sure i understand the order of your table joining i just reordered them and it works. SELECT cats.Ca

Joining a table to itself

2008-07-08 Thread Jim MacDiarmid
I'm hoping someone can help me with this. I have a table of categories that I'm trying to join to itself, but I keep getting the error "unknown column: Cats1.parentid in on clause". Here is the SQL for the table: CREATE TABLE `vb_ldcats` ( `catid`int(10) AUTO_INCREMENT NOT NULL

RE: delete query question

2008-07-08 Thread Jeff Mckeon
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 = table1.ID > >Table2 is a many to 1 relations

Re: which query solution is better?

2008-07-08 Thread Lamp Lists
- Original Message From: John Hicks <[EMAIL PROTECTED]> To: Lamp Lists <[EMAIL PROTECTED]> Cc: mysql@lists.mysql.com Sent: Tuesday, July 8, 2008 11:20:16 AM Subject: Re: which query solution is better? Lamp Lists wrote: > hi, > I would like to get your opinions regarding which query you

Re: which query solution is better?

2008-07-08 Thread John Hicks
Lamp Lists wrote: hi, I would like to get your opinions regarding which query you think is better solution and, of course - why. I have (very simplified example) 3 tables: orders, members and addresses I need to show order info for specific order_id, solution 1: select ordered_by, order_date,

Re: delete query question

2008-07-08 Thread Peter Brawley
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

RE: delete query question

2008-07-08 Thread Ian Simpson
Oh well ;) It looks like you can use joins in a delete statement, and delete the joined rows, which will delete from the individual tables. So something like: delete table1, table2 from table1 inner join table2 on table1.ID = table2.ticket where... should do it I modified the above code from

RE: delete query question

2008-07-08 Thread Jeff Mckeon
> -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 key > relationship between th

Re: delete query question

2008-07-08 Thread Ian Simpson
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

which query solution is better?

2008-07-08 Thread Lamp Lists
hi, I would like to get your opinions regarding which query you think is better solution and, of course - why. I have (very simplified example) 3 tables: orders, members and addresses I need to show order info for specific order_id, solution 1: select ordered_by, order_date, payment_method, order

delete query question

2008-07-08 Thread Jeff Mckeon
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