Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Retrieve values between two numbers in mysql
12-13-2011, 04:39 AM
Post: #1
Tongue Retrieve values between two numbers in mysql
Guys today we are going to know how to retrieve the values between two specific numbers using mysql command.
See the example below
Get the id values in two numbers or simply assign it like n1=1,n2=5.
Now use

select * from tablename where id BETWEEN '"+n1+"' AND '"+n2+"'.

This will retrieve all table values from id=1 to 5. Any doubt ask us.Do comment us to help you.

Happy Coding
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies Views: Last Post
Tongue Finding/removing duplicate values from database using sql rajasri 0 61 12-19-2011 10:17 PM
Last Post: rajasri
Sad how to export a csv using INTO syntax of mysql rajasri 0 95 12-13-2011 04:42 AM
Last Post: rajasri
Smile How to backup database of mysql using bat rajasri 0 177 12-13-2011 02:41 AM
Last Post: rajasri
Wink Exception:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for colu rajasri 0 360 12-13-2011 02:09 AM
Last Post: rajasri

Forum Jump:


User(s) browsing this thread: 1 Guest(s)


WE will share important jobs and updates on facebook so like us to get updates