Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql problem, how can i return record row no in table all
Message
 
 
À
20/02/2012 22:56:38
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01535912
Message ID:
01536082
Vues:
46
>Hi all,
> I use vb.net and visual foxpro to database(.dbf). I want to write a function and return row no.
>for example, table and 5 record ( sysid sysname )
> 001 add
> 002 update
> 005 delete
> 009 save
> 100 print
>
>How can i do, Thank you ~~~
>
>
>select ??? from systable where sysname='delete'
>
>I want to return 3 (row 3 in table )


Looks like you need to number first, e.g.

SQL Server:
;with cte as (select *, row_number() over (order by SysID) as Rn from ...)

select * from cte where SysName = 'delete'
For VFP you may try
select * from .. into cursor csrTemp NOFILTER ORDER BY SysID

select *, recno() as Rn from csrTemp where SysName = 'delete'
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