MySQL python query for extracting data from columns -
i need construct query in mysql, output data. table named "data" , containig 3 columns "col1" in wich dates, not in sql format, "col2" contains times, , "col3" contains values need output. how construct query first check col1 specific date , check col2 specific time range between date in first column, , return values of selection.
i have tried this:
sql = "select * `data` `col 1`='6.9.2015' , time(`col 2`) between '23:00:00' , '23:59:00'"
but query returns date of 7.9.2015.
thank in advance answers.
the problem using =
compare strings. replace =
like
in order string comparisons.
also, if want return col3
output, replace select *
select 'col3'
.
Comments
Post a Comment