By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,419 Members | 1,636 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,419 IT Pros & Developers. It's quick & easy.

Get sql row count

Sl1ver
100+
P: 196
Im writing a sql query and i need to get the row count of one select statement and join the other select statement on the first one -1. Essencially giving data on the left hand side, and the same data on the right hand side but it's first line shows where the left hand side is on the 2 row
e.g
1 __
2__ 1__

select
*
*from
(
select
rowcount or something
*
*
from
) rev
(
select
rowcount or something
*
*
from
) evr
left joinevr on rev-1

something like that
Jan 22 '10 #1
Share this Question
Share on Google+
2 Replies


P: 3
write the following if you want to count the no of rows

select count(*) from tablename;
or
select count(fieldname1,..) from tablename;

i hope this help you littlemore...
Jan 22 '10 #2

Sl1ver
100+
P: 196
thanx
used

row_number() over (order by poh__number) row,

works perfect
Jan 22 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.