shell script to extract mysql data
Posted on 2014-11-17
I need a bash script which does the following.
-reads from one table in mysql
-extracts data from one field if another field is a 1
-writes output to a file, each result on a new line
-moves on to next row
Each client has a row of information. We want to read each row and determine if we need to output
if field 'test' = 1 then read 'location' field and put that into a file on a new line.
Move on to next row.
If possible, reading a large number of rows into memory to save on number of reads because table could contain thousands of clients if not tens of thousands.