This small code helps you to do a query that count all rows, using the statement COUNT. Is very easy and simple, but maybe could be very useful.

SELECT (SELECT COUNT(*) FROM authors e2 WHERE e2.au_id <= e.au_id)
AS rownumber, au_id, au_lname
FROM authors e ORDER BY au_id
자료출처 : http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=5&txtCodeId=821
'SQL' 카테고리의 다른 글
| ArrayToSingle 사용자정의 함수 (0) | 2007/06/07 |
|---|---|
| @@ROWCOUNT을 이용한 update/insert 저장프로시저 (0) | 2007/06/07 |
| 테이블에 행번호 만들기 (0) | 2007/06/07 |
| SQL 서버의 핵심 T-SQL의 새로운 기능 (0) | 2007/06/07 |
| SQL 서버 2005 관리자가 알아야 할 변화 (0) | 2007/06/07 |
| SQL Server DBA 가이드 (0) | 2007/06/07 |
0 Trackback,
0 Comment,
:




최근에 달린 댓글
링크
최근에 받은 트랙백
태그목록