python - mysql use between values in a join statement -


i have following 2 tables dmu , ter

>>> sqldf('select distinct begin, end dmu', globals())   begin end 0    56  65    >>> sqldf('select distinct begin, end ter', globals())    begin end 0      0   4 1      5   9 2      9  12 3     13  17 4     18  26 5     26  27 6     28  31 7     32  35 8     36  37 9     38  44 10    45  52 11    53  55 12    56  65 13    65  66 

and want select rows ter.begin between dmu.begin - 15 , dmu.begin

i.e. rows ter be:

10    45  52 11    53  55 12    56  65 13    65  66 

so have tried:

sqldf('select * dmu         inner join ter         on ter.begin between dmu.begin - 15 , dmu.begin',        globals()) 

(i calling mysql python shouldn't matter).

this returns empty table! why? can not use between statement in join statement? - 15 part throwing off somehow?


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -