mysql - How to use between and greater than in sql -


table name:tax        slab1    slab2    tax         0        10000   0         10001    50000   10         50001    100000  20         100001    0      30 

here 0 represents infinity.

my table this.i have find tax of 60000.i dont't know how use between , greater in sql together.

i tried this: $query="select * taxsettings          $liable2 between tax.slab1 , tax.slab2             or $liable2 > tax.slab1"; 

$liable2 amount. 1 can how insert infinity value db table

try query

"select * taxsettings          $liable2 between case when tax.slab1=0 $liable2 else tax.slab1 end  , case when tax.slab2 =0 $liable2 else tax.slab2 end;" 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -