Click here to Skip to main content
15,900,906 members
Home / Discussions / Database
   

Database

 
GeneralRe: Table design for storing email address Pin
Anonymous21-Apr-05 10:39
Anonymous21-Apr-05 10:39 
GeneralExtract Create Index Script Pin
-Dr_X-20-Apr-05 11:40
-Dr_X-20-Apr-05 11:40 
GeneralSQL execution path question Pin
Judah Gabriel Himango20-Apr-05 9:12
sponsorJudah Gabriel Himango20-Apr-05 9:12 
GeneralRe: SQL execution path question Pin
Andy Brummer20-Apr-05 9:53
sitebuilderAndy Brummer20-Apr-05 9:53 
GeneralRe: SQL execution path question Pin
Colin Angus Mackay20-Apr-05 9:55
Colin Angus Mackay20-Apr-05 9:55 
GeneralRe: SQL execution path question Pin
-Dr_X-21-Apr-05 5:59
-Dr_X-21-Apr-05 5:59 
GeneralInserting at a specific row Pin
Esmo200020-Apr-05 8:29
Esmo200020-Apr-05 8:29 
GeneralRe: Inserting at a specific row Pin
Colin Angus Mackay20-Apr-05 9:06
Colin Angus Mackay20-Apr-05 9:06 
Databases are set based systems, therefore there is no concept of the "top of [the] table". However, clustered indexes mean that even although there is no logical concept there is a physical structure in place which will put a row at the top of the table. So, perhaps what you needing to do is to create a clustered index on the column that you want to determine the sequence of the rows. However, you need to be careful as this will be the order that the rows are physically stored. Clustered indexes do not work so well if the column values are not unique as any searches will have to resort to a sequential search if there are duplicate values.

Alternatively, if all you need is a specific order, for example display purposes, then what you need to do is to create a new column to store some sort of virtual row number, you can then assign a number to it indicating the row's position in the table. When you need to have the rows being returned in a certain sequence you can use the ORDER BY clause on the SELECT statement to return the rows in the order you need.

Does this help?


My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralA sytax question Pin
Esmo200020-Apr-05 8:05
Esmo200020-Apr-05 8:05 
GeneralRe: A sytax question Pin
Colin Angus Mackay20-Apr-05 9:08
Colin Angus Mackay20-Apr-05 9:08 
GeneralExecuting an UPDATE for each record returned by a SELECT Pin
Luis Alonso Ramos20-Apr-05 6:09
Luis Alonso Ramos20-Apr-05 6:09 
GeneralRe: Executing an UPDATE for each record returned by a SELECT Pin
Colin Angus Mackay20-Apr-05 7:23
Colin Angus Mackay20-Apr-05 7:23 
GeneralRe: Executing an UPDATE for each record returned by a SELECT Pin
Luis Alonso Ramos20-Apr-05 8:11
Luis Alonso Ramos20-Apr-05 8:11 
GeneralRe: Executing an UPDATE for each record returned by a SELECT Pin
Colin Angus Mackay20-Apr-05 9:39
Colin Angus Mackay20-Apr-05 9:39 
GeneralRe: Executing an UPDATE for each record returned by a SELECT Pin
Luis Alonso Ramos20-Apr-05 13:02
Luis Alonso Ramos20-Apr-05 13:02 
GeneralRe: Executing an UPDATE for each record returned by a SELECT Pin
Colin Angus Mackay20-Apr-05 20:29
Colin Angus Mackay20-Apr-05 20:29 
GeneralData Source for Reporting Services Pin
azam31620-Apr-05 3:15
azam31620-Apr-05 3:15 
GeneralRe: Data Source for Reporting Services Pin
NewSilence23-Apr-05 13:17
NewSilence23-Apr-05 13:17 
GeneralRe: Data Source for Reporting Services Pin
azam31625-Apr-05 4:51
azam31625-Apr-05 4:51 
GeneralHey guys, Pin
Wilbur J. Pereira20-Apr-05 2:26
Wilbur J. Pereira20-Apr-05 2:26 
QuestionSQL Server : Add user login in a trigger? Pin
Duncan Edwards Jones20-Apr-05 0:12
professionalDuncan Edwards Jones20-Apr-05 0:12 
AnswerRe: SQL Server : Add user login in a trigger? Pin
Mike Dimmick20-Apr-05 1:23
Mike Dimmick20-Apr-05 1:23 
GeneralRe: SQL Server : Add user login in a trigger? Pin
Duncan Edwards Jones20-Apr-05 2:16
professionalDuncan Edwards Jones20-Apr-05 2:16 
Generalauotmatically generating a unique ID number [* Resolved *] Pin
steve_rm19-Apr-05 21:50
steve_rm19-Apr-05 21:50 
GeneralRe: auotmatically generating a unique ID number Pin
Mike Dimmick19-Apr-05 23:25
Mike Dimmick19-Apr-05 23:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.