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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -