I have the following scripts that renumber a column based on the sort order of another column. it also allows for a starting number so I can get a TOP(n) number of records on top of the list and then sort the reamining items in alphabetical order.
I am trying to figure out why sometimes it does not order the result correctly. for Example, it puts "Lancia" after "Landrover". I am suspecting that the "where t2.make < t.make) is not returning the correct result and it causing this to happen.
If there is better/simpler way to do this, I would appreciate any input.
Make is a varchar(50)
OrderNumber is an int
DECLARE @StartingNumber integer
set @startingnumber = 6
set t.ordernumber = (select count(1) from MakeTable t2 where t2.Make < t.Make) + @startingnumber
From makesandmodels t
WHERE t.OrderNumber > 7
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have.