Skip to content

reference to column position without --no-header option #55

Answered by mithrandie
mirkoperillo asked this question in Q&A
Discussion options

You must be logged in to vote

You can specify a column by using the table name and column number starting with 1 in the table.

$ cat sample.csv
column1,column2
1,a
2,b

$ cat sample2.csv
column3,column4
1,c
2,d

$ csvq 'SELECT t1.1, t1.2, t2.2 FROM `sample.csv` t1 INNER JOIN `sample2.csv` t2 ON t1.1 = t2.1'
+------+------+------+
| t1.1 | t1.2 | t2.2 |
+------+------+------+
| 1    | a    | c    |
| 2    | b    | d    |
+------+------+------+

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mirkoperillo
Comment options

Answer selected by mithrandie
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants