Re: How to export data with column names?

2011-02-13 Thread chamila gayan
you have to use 2 select for do this. The first select generates the headerline and the second the data. ( SELECT 'FieldA','FieldB','FieldC', ... ) UNION ( SELECT `FieldA`, `FieldB`, `FieldC`, ... INTO OUTFILE 'D:/data.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' FROM ... ... GROUP BY

How to export data with column names?

2011-02-13 Thread mos
I want to use select * into outfile "myfile.txt" from table1; and have it export the data as tab delimited but with the column names. I need the column names because the import utility will use that to create the table in another (non-MySQL) database. As it stands, I can't get the column nam

Re: Simplify 4 queries into 1

2011-02-13 Thread mos
At 05:39 PM 2/13/2011, Andre Polykanine wrote: Hi all, Hope this question is appropriate here :-). I've got 4 queries: $q1=mysql_query("SELECT *FROM`CandidateQuestions`WHERE `Category`='1' ORDER BY RAND() LIMIT 1"); $q2=mysql_query("SELECT *FROM`CandidateQuestions`

Simplify 4 queries into 1

2011-02-13 Thread Andre Polykanine
Hi all, Hope this question is appropriate here :-). I've got 4 queries: $q1=mysql_query("SELECT *FROM`CandidateQuestions`WHERE `Category`='1' ORDER BY RAND() LIMIT 1"); $q2=mysql_query("SELECT *FROM`CandidateQuestions`WHERE `Category`='2' ORDER BY RAND() LIMIT 1");

Re: Messed up mysql-server, cant reinstall?!

2011-02-13 Thread Andrés Tello
didn't u forgot to run mysql_intsall_db? On Fri, Feb 11, 2011 at 6:53 AM, Adam smalin wrote: > I accidentally drop the database mysql. I now cannot restore tables to the > database or do much of anything some details can be found here > > http://serverfault.com/questions/234321/i-accidently-dr

Re: is your lack of a degree holding you back?

2011-02-13 Thread Jan Steinman
That has got to be one of the most surreal conversations I've seen on a mailing list! Reminds me of the time I got tired of some boring lout on a Usenet group, and so I wrote up a markov-3 "bot" that would automatically respond to his postings, and then he got into a heated debate with himself.

How to export data with column names?

2011-02-13 Thread mos
I want to use select * into outfile "myfile.txt" from table1; and have it export the data as tab delimited but with the column names. I need the column names because the import utility will use that to create the table in another (non-MySQL) database. As it stands, I can't get the column nam

Performance issue old server witn mysql 4 vs new server with mysql 5 and old server WINS!

2011-02-13 Thread Andrés Tello
I have a test process, which runs in the "old server" in 35 seconds, the new server runs the same process in 110. There is a change of version from mysql 4.1.22 to 5.1.22. We were stuck at 5.1.22 because higher version give us another issules like encoding, case sensitivity... I really belive th