Right now i am just using simple query to fetch data but it fetching like the way i store in database linewise . But i want to fetch randomly but how ??
here is my query
Select * from FOOD where food_price <= ?
Right now i am just using simple query to fetch data but it fetching like the way i store in database linewise . But i want to fetch randomly but how ??
here is my query
Select * from FOOD where food_price <= ?
If you want it in a range from 1 to 100:
SELECT * FROM FOOD WHERE food_price <= ? ORDER BY RAND()
In SQL Server I use newid():
select *
from FOOD
where price <= ?
order by newid();