How to create a tab delimited select statement?

I need to combine the columns with the selected status so that it creates a tab delimited file.

For. eg

Select ColumnA || "," || ColumnB

The above instruction will create a Comma Seperate file. What should I write to create a tab delimited file?

Please let me know.

+5
source share
4 answers

MySQL:

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

SQL Server:

select ColumnA + char(9) + ColumnB

Oracle:

select ColumnA || chr(9) || ColumnB
+11
source

If I understand your question, you should try the following:

SELECT CONCAT(ColumnA, '\t', ColumnB)
+2
source
+1

Postgresql:

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

All Articles