Re: COUNT returned rows of a SELECT

2008-07-30 Thread Ananda Kumar
SELECT aviName,MAX(dateTime) ,count(*) FROM aviTrackerMain WHERE DATE(dateTime) LIKE CONCAT(DATE(NOW()),'%') GROUP BY aviName; This will also give you count of rows On 7/31/08, Fish Kungfu <[EMAIL PROTECTED]> wrote: > > Using MySQL commands only (not PHP's mysql_num_rows), is there a way to >

COUNT returned rows of a SELECT

2008-07-30 Thread Fish Kungfu
Using MySQL commands only (not PHP's mysql_num_rows), is there a way to COUNT the number of rows returned from a SELECT.GROUP BY? My primary SELECT query is this: SELECT aviName,MAX(dateTime) FROM aviTrackerMain WHERE DATE(dateTime) LIKE CONCAT(DATE(NOW()),'%') GROUP BY aviName; And it faith

Re: Re-arranging fields

2008-07-30 Thread Mr. Shawn H. Corey
On Wed, 2008-07-30 at 14:42 -0400, Jerry Schwartz wrote: > Is there any reasonable way of re-arranging the order of columns in a table > without losing their data? The best I could come up with was to copy the > table, empty it, and then do an INSERT . SELECT specifying the new order of > the field

Re: Re-arranging fields

2008-07-30 Thread Rob Wultsch
Something like ALTER TABLE [TABLE] MODIFY [COLUMN] col_name column_definition [FIRST | AFTER col_name] shoudl work http://dev.mysql.com/doc/refman/5.0/en/alter-table.html On Wed, Jul 30, 2008 at 11:42 AM, Jerry Schwartz <[EMAIL PROTECTED]> wrote: > Is there any reasonable way of re-arranging the

Re: Re-arranging fields

2008-07-30 Thread Ranjeet Walunj
Jerry Schwartz wrote: Is there any reasonable way of re-arranging the order of columns in a table without losing their data? The best I could come up with was to copy the table, empty it, and then do an INSERT . SELECT specifying the new order of the fields. This can also be achieved in followi

Re-arranging fields

2008-07-30 Thread Jerry Schwartz
Is there any reasonable way of re-arranging the order of columns in a table without losing their data? The best I could come up with was to copy the table, empty it, and then do an INSERT . SELECT specifying the new order of the fields. Regards, Jerry Schwartz The Infoshop by Global

Re: spool log to a file

2008-07-30 Thread walter harms
that is a shell question using bash/ksh stuff you can use this: mysql -uroot -pxxx -Dtest -s -e 'select * from amc_25;' > 1.txt 2>&1 Ananda Kumar wrote: > The problem with below statement is that, if i there is any error in sql > statements it does not get written to 1.txt. So, even

Re: spool log to a file

2008-07-30 Thread Ananda Kumar
Thank u, this works. On 7/30/08, Jim Lyons <[EMAIL PROTECTED]> wrote: > > Try: > > mysql -uroot -pxxx -Dtest -s -e 'select * from amc_25;' > 1.txt 2> > 1.txt > > or > > mysql -uroot -pxxx -Dtest -s -e 'select * from amc_25;' > 1.txt 2> > 1.errs > > This will redirect STDERR.

Re: locked file mysqld-nt.exe when re-installing mysql on windows server

2008-07-30 Thread Johan Gant
That worked for me, much appreciated. Thanks 2008/7/30 Ananda Kumar <[EMAIL PROTECTED]> > got to > > start-->run--(type regedit)-->HKEY_LOCAL_MACHINE--->SOFTWARE > folder--->delete all mysql folder > > Then in SYSTEM Folder --->controlset001-->services---> delete all mysql > entries. Do the same

Re: locked file mysqld-nt.exe when re-installing mysql on windows server

2008-07-30 Thread Ananda Kumar
got to start-->run--(type regedit)-->HKEY_LOCAL_MACHINE--->SOFTWARE folder--->delete all mysql folder Then in SYSTEM Folder --->controlset001-->services---> delete all mysql entries. Do the same for controlset002 and controlset003 After above is done try to delete the file in C:\mysql\bin folder