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); +-

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: http://www.economist.

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 wrote: > Hey all, > > I was building a table for storing email addresses

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 byt

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 (1

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 11/10

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 >

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: DRO

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 wrote: > At 12:13 PM 11/8/2009, John Meyer wrote: > > Now

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 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 table >

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 app-armo

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 (1,2,3,7,9

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 wrote: > Hi, > > I followed the instructions but still get:

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 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 domain, an