문제

I have 3 columns in a mysql table like that

COL1       COL10      COL11
longblob1 longblob10  longblob11

I want to output everything with the following format :

 @COL1 COL10
 +
 COL11 

(It's called a fastq file for lil' biochemist like me out there ..)

So I thought querying the output like that, but it doesn't go to next line it just prints out /n as a character .. :

SELECT '@',COL1, COL10,'/n','+','/n',COL11 FROM MYTABLE
INTO OUTFILE '/MYPATH/MYFILE.TXT';
도움이 되었습니까?

해결책

You are searching for string concatenation (additionaly, you are escaping wrong, it's \n, not /n):

SELECT CONCAT('@', COL1, COL10, '\n+\n', COL11) FROM MYTABLE
INTO OUTFILE '/MYPATH/MYFILE.TXT';

Learn more about CONCAT() here.

다른 팁

It should if you use the concat() function:

SELECT CONCAT('@',COL1, COL10,'\n','+','\n',COL11) FROM MYTABLE
INTO OUTFILE '/MYPATH/MYFILE.TXT';
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top