i have a problem with sorting this thing... i want to sort a column without changing the data in the other column. i have an attached document. a picture of my query and database.. tnx :)

Recommended Answers

All 3 Replies

it is not possible ,if you use order by desc then it will sort all records descending order . but you want just to show single column like this , this will will effect all the related records

I don't understand either what you are asking, or why you are asking what I think you are.
It is not possible to retrieve records from a table with 2 separate sorts. Then you are not retrieving records, but 2 separate lists - which have nothing to do with each other.
If the later is your case then use 2 different queries.
If it's not, then can you please explain what you expect to get by "breaking" the association between employeeID and LastName ? It will make the results useless (LastName ABADIANO won't have employeeID 000000706, but some random one and this is against the logic of a db).

i import it to the excel file. i copied the EmployeeID to another excel file then sort it to ascending then copied it to original excel file then export to sql database :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.