I have a search page in which I am searching data by passing multiple parameters. I am using StartDate (Datetime field) as default sort order (result are sorted on the basis of StartDate if no sort order is provided). While searching I am getting random row order of data when multiple rows have same StartDate.
Can anybody tell me what is the reason for this?
Thanks
I have a search page in which I am searching data by passing multiple
Share
If you don’t explicitly define a sort order, there is no guaranteed order for the rows to be returned in.
If you
ORDER BYa single field, the order of rows within groups that have a match on that field is indeterminate unless you define it.I’m not sure what you expect to get back order-wise. If you have an order you would like, you must specify it to get those rows in that order.
Period.