Jump to content

Mysql Query not Fetch right result


beboo002

Recommended Posts

Hello all

 

Mysql Query not  Fetch right result

 

My table looks like

 

 

 

id subid mincost maxcost mode mode1

 

1 0 1 4000 1 rent

 

2 0 4001 6000 2 rent

 

3 0 6001 10000 3 rent

 

4 0 10001 15000 4 rent

5 0 15001 20000 5 rent

 

6 0 20001 25000 6 rent

 

7 0 25001 40000 7 rent

 

8 0 40001 70000 8 rent

 

9 0 70001 100000 9 rent

 

10 0 100001 150000 10 rent

 

11 0 150001 200000 11 rent

 

12 0 200001 500000 12 rent

 

13 0 500001 1000000 13 rent

 

14 0 Above 10+ lacs Above 10+ lacs 14 rent

 

16 1 1 4000 1 rent

 

17 2 4001 6000 2 rent

 

18 3 6001 10000 3 rent

 

19 4 10001 15000 4 rent

 

20 5 15001 20000 5 rent

 

21 6 20001 25000 6 rent

 

22 7 25001 40000 7 rent

 

23 8 40001 70000 8 rent

 

24 9 70001 100000 9 rent

 

25 10 100001 150000 10 rent

 

26 11 150001 200000 11 rent

 

27 12 200001 500000 12 rent

 

28 13 500001 1000000 13 rent

 

29 14 Above 10+ lacs Above 10+ lacs 14 rent

 

 

 

Now I fire a query which is search subid

 

select subid from pay_code where mincost<'300000'  and mode1='rent' order by subid desc limit 1;

 

Its gives subid=7, which is wrong it gives subid=12

 

Thanks

beboo

 

Link to comment
https://forums.phpfreaks.com/topic/104169-mysql-query-not-fetch-right-result/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.