Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serializing rows
Message
 
 
À
09/12/2009 10:04:58
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01438197
Message ID:
01438198
Vues:
55
>I have a brain block this AM
>This table contains transactions on sales orders that must be serialized in a seq column (int) by adddate (datetime) within sales order order sono (char).
>So, if a sales order has 10 transactions the seq column must be 1,2,3, etc in ascending order by adddate.
>Because of insertions, deletions, etc, I need to be able to reserialize the transactions for a given sales order with a tsql command(s).
>Can anyone unbock my brain?
select sono, AddDate, row_number() over (partition by Sono order by AddDate) as Seq from Transactions
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform