Re: Cross-table constraint

2009-11-10 Thread Johan De Meersman
I think triggers are your only option, here. On 11/9/09, Sebastiaan van Erk sebs...@sebster.com wrote: Hi, I have the following model: Domain (*)-(1) Account (*)-(1) User That is, each user belongs to exactly 1 account, an account can have multiple users; each account belongs to a single

Re: Temp file issues on Ubuntu 9.10

2009-11-10 Thread Ananda Kumar
does the table ur trying to delete has any primary-foreign key relation. do show create table table_name\G Also instead of delete, use truncate, i t will be faster. regards anandkl On Tue, Nov 10, 2009 at 3:19 AM, Sebastiaan van Erk sebs...@sebster.comwrote: Hi, I followed the instructions

Re: 2 Queries need to combine into one

2009-11-10 Thread Ananda Kumar
select (SELECT dealer.FIRMID, (COUNT(*) -1) * 25.00 + 270.00 AS FEE FROM `dealer` `dealer` INNER JOIN `branches` `branches` ON (`branches`.`FIRMID` = `dealer`.`FIRMID`) WHERE (( `dealer`.`CRD_NUM` = 0 ) OR ( `dealer`.`CRD_NUM` IS NULL )) AND ( `dealer`.`LIC_TYPE` IN

Re: Temp file issues on Ubuntu 9.10

2009-11-10 Thread Sebastiaan van Erk
Hi, I have got the correct answer now, from Linus Larsson, just forwarding it for the archives: ---8--- Hello, my name is Linus Larsson. I saw you got a problem with mysql on Ubuntu 9.10, I was researching the exact same problem and found your post. In the end I turned off

Re: Finding users who haven't posted in a week

2009-11-10 Thread Ananda Kumar
make sure u have a WHERE CLAUSE for the update , otherwise, entire data for that column will be seto Y On Mon, Nov 9, 2009 at 9:10 PM, mos mo...@fastmail.fm wrote: At 12:13 PM 11/8/2009, John Meyer wrote: Now I'm wondering if I can use this query in an update to set a variable in a second

Re: Finding users who haven't posted in a week

2009-11-10 Thread Johnny Withers
Update tweets, t2 set t2.active=0 where tweets.user_id=t2.user_id and (rest of tweets where cond) I'm on a mobile device, but that query should work, just do not leave the tweets=t2 cond out of the where. On Monday, November 9, 2009, mos mo...@fastmail.fm wrote: At 12:13 PM 11/8/2009, John

RE: DROP TABLE TOOK 39MIN

2009-11-10 Thread Parikh, Dilip Kumar
But if you restart your mysql and then drop the table, It will take only 2 min to drop the table. Thanks, Dilipkumar -Original Message- From: Krishna Chandra Prajapati [mailto:prajapat...@gmail.com] Sent: Tuesday, November 10, 2009 12:04 AM To: Michael Dykman Cc: MySQL Subject: Re:

Re: DROP TABLE TOOK 39MIN

2009-11-10 Thread Johan De Meersman
Restarting isn't an option in most production environments, but I wonder why you say that it'd take far less time after a restart ? On Tue, Nov 10, 2009 at 4:47 PM, Parikh, Dilip Kumar dilipkumar.par...@eds.com wrote: But if you restart your mysql and then drop the table, It will take only 2

Re: 2 Queries need to combine into one

2009-11-10 Thread Robin Brady
Initially I received the operand should only have one column so I removed the dealer.FIRMID from the select statement and then the query just returns NULL. Each query works fine on its own but I can't seem to combine it so that is gives me the total of the fees. Robin Ananda Kumar

Re: 2 Queries need to combine into one

2009-11-10 Thread Peter Brawley
Robin, select (SELECT dealer.FIRMID, (COUNT(*) -1) * 25.00 + 270.00 AS FEE FROM `dealer` `dealer` INNER JOIN `branches` `branches` ON (`branches`.`FIRMID` = `dealer`.`FIRMID`) WHERE (( `dealer`.`CRD_NUM` = 0 ) OR ( `dealer`.`CRD_NUM` IS NULL )) AND ( `dealer`.`LIC_TYPE` IN

storage difference in VARCHAR(size)?

2009-11-10 Thread Waynn Lue
Hey all, I was building a table for storing email addresses today and ran into an issue that I couldn't find an answer for using Google. If I declare the column as a VARCHAR (this is an InnoDB table), does it matter what size I declare it as if it's between 1 and 255? I know there's an extra

Re: storage difference in VARCHAR(size)?

2009-11-10 Thread Michael Dykman
You have stumbled across the secret. No, there is no difference at all as the calculations suggested here confirm. http://dev.mysql.com/doc/refman/5.1/en/storage-requirements.html On Tue, Nov 10, 2009 at 6:37 PM, Waynn Lue waynn...@gmail.com wrote: Hey all, I was building a table for storing

Oracle, Sun and MySQL

2009-11-10 Thread Peter Brawley
European regulators agree with Monty that the Oracle-Sun deal threatens database competition. Apparently Oracle means to play hardball. Meanwhile Sun revenue fell 25% in 3rd quarter 2009; who else but an anti-competitive giant would take a chance on buying Sun now? Story here:

Re: 2 Queries need to combine into one

2009-11-10 Thread Ananda Kumar
select * from a; +--+ | id | +--+ |1 | |2 | +--+ 2 rows in set (0.00 sec) mysql select * from b; +--+ | id | +--+ |1 | |2 | +--+ 2 rows in set (0.00 sec) mysql mysql select (select id from a where id=1) + (select id from b where id=1);