Re: Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-11-27 Thread Nishikant Kapoor
Thanks for the response, Andy. I am now using the SELECT subquery to fix that problem. However, when I run the following query (b) on 5.0.22, I don't get any results - with and without the fix. CREATE TABLE t ( id TINYINT, title VARCHAR(10) ); INSERT INTO t (id, title) VALUES (1, 'aaa'), (2, 'b

Re: Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-11-27 Thread Nishikant Kapoor
Looking further for more info on this issue reveals that there is a bug in MySQL 5.0.51: http://bugs.mysql.com/bug.php?id=32202 which got fixed in 5.0.52. Thanks, Nishi Nishikant Kapoor wrote: CREATE TABLE t ( id TINYINT, title VARCHAR(10) ); INSERT INTO t (id, title) VALUES (1, 'aaa'), (2,

Re: Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-11-27 Thread Andy Shellam
Hi Nishi, There was a bug in that version that affected the sort order when combined with a group by statement (http://bugs.mysql.com/bug.php?id=32202.) There are a couple of workarounds but they are bad (e.g. removing primary key!) I would strongly suggest you upgrade to 5.0.67 or possibly

Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-11-27 Thread Nishikant Kapoor
CREATE TABLE t ( id TINYINT, title VARCHAR(10) ); INSERT INTO t (id, title) VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc'), (4, 'ddd'), (5, 'eee'); (a) DO @sn := 0; SELECT @sn:[EMAIL PROTECTED] sn, id, title FROM t GROUP BY id ORDER BY id desc; | sn | id | title | +--+--+---+ |1

Re: Logging all Access

2008-11-27 Thread Darvin Denmian
Help and much, thank you for the answer, I just want to know if there is something specific to the purpose of the access log of users. But the alternative is a good start :) On Thu, Nov 27, 2008 at 3:06 PM, Andy Shellam <[EMAIL PROTECTED]> wrote: > Hi Darvin, > > Does this not help? > > http://dev

Re: Logging all Access

2008-11-27 Thread Andy Shellam
Hi Darvin, Does this not help? http://dev.mysql.com/doc/refman/5.0/en/query-log.html (replace 5.0 with 5.1 if you've already upgraded.) "The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it log

Re: linq with mysql

2008-11-27 Thread Andy Shellam
Hi, For those not familiar with LINQ, it's a new Microsoft feature in it's .NET languages that is supposed to allow developers to write querying language (i.e. SQL) code in the same format as the .NET language (e.g. C#.) The .NET compiler will convert the code into a SQL statement - e.g. I c

Logging all Access

2008-11-27 Thread Darvin Denmian
I wonder if there is the possibility of registering the users' access to the server Mysql. Something similar to the command "last" of Unix-like systems. Thanks. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTE

Re: SELECT locking tables.... in other databases

2008-11-27 Thread David Scott
Thanks for the improved query.The indexing didn't help much and still the main problem is it locking all updates to the tables while it executes... even if I am executing it on a copy of the tables in a different database -- Dave 2008/11/27 Chandru <[EMAIL PROTECTED]> > Hi David, > please create

Re: SELECT locking tables.... in other databases

2008-11-27 Thread Pradeep Chandru
Hi David, can you please let me know what is the select query and the update query along with the explain plan of the same. can you please let me know if you are using innodb storage engine? Regards, Chandru www.mafiree.com On Thu, Nov 27, 2008 at 4:45 PM, David Scott <[EMAIL PROTECTED]>wrot

Re: SELECT locking tables.... in other databases

2008-11-27 Thread David Scott
show full processlist userX is the user the site is using to connect databaseX is the database in question 1976156, 'userX', 'localhost', 'databaseX', 'Sleep', 13, '', '' 13508974, 'dave', 'IPX:29212', 'databaseX', 'Sleep', 0, '', '' 13759139, 'sen', '1 IPX:32775', '', 'Sleep', 160, '', '' 1377562

Re: SELECT locking tables.... in other databases

2008-11-27 Thread Ananda Kumar
can u please do "show full processlist" when the update is happening, and if its innodb please do "SHOW INNODB STATUS", which will give complete activity on innodb engine, including lock information. Please show use the output of these. regards anandkl On 11/27/08, David Scott <[EMAIL PROTEC

SELECT locking tables.... in other databases

2008-11-27 Thread David Scott
Hi list.We have 2 tables, both have a few inserts, many updates and the occasional select. When running a select joining the 2 tables (which can take upto 20 seconds to complete, they are large tables) all updates are blocked and the maxconnections is quickly reached. We tried copying the data to