Question

i am running this query (mysql workbench) which works perfectly.

select * from message where date between '2001-09-09 00:00:00' and '2001-09-10 00:00:00'

the results of this query are a number of various columns, of which i am only interested in one named 'body'.

How do i go about exporting only the 'body' column that has resulted from the above query?

Thanks!!

Was it helpful?

Solution

Just include the column(s) you want after select instead of using * ("all"):

select body from message where date between '2001-09-09 00:00:00' and '2001-09-10 00:00:00'

The column(s) you select and the column(s) by which you filter can be two entirely different sets of columns.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top