a table loadcount have two attributes did and count.i need to select did where the count is lowest. for example if:
did count
657 0
698 1
then 657 has to be returned. similary if two rows have same count value and both are lowest then one of them needs to be selected at random.plzz help me.My academic project submission deadline is very near and i couldnt figure it on my own.Plzz provide me with codes,sql query.I am using microsoft access and java for the project.
you can use the MIN function to find the lowest one
so in this case it would be
to select a random cell from the MIN info returned , it depends on what you are using MySQl, PostgreSQL, etc…
Select a random row with MySQL:
Select a random row with PostgreSQL:
Select a random row with Microsoft SQL Server:
Select a random row with IBM DB2
Select a random record with Oracle: