7

I need to combine columns with select statment such that it create a tab delimited file.

For. e.g

Select ColumnA || "," || ColumnB

Above statement will create Comma Seperate File. What should I write to create Tab delimited file?

Please let me know.

0

5 Answers 5

13

MySQL:

select concat(ColumnA, "\t" ,ColumnB)

SQL Server:

select ColumnA + char(9) + ColumnB

Oracle:

select ColumnA || chr(9) || ColumnB
2

If I understand your question, you should try this:

SELECT CONCAT(ColumnA, '\t', ColumnB)
1

Postgresql:

select concat(ColumnA, chr(9), ColumnB)
1

Tab is char(9) in Microsoft SQL Server.

source: http://msdn.microsoft.com/en-us/library/ms187323.aspx

0

SQLite:

select ColumnA || char(9) || ColumnB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.