Get sql row count

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sl1ver
    New Member
    • Mar 2009
    • 196

    #1

    Get sql row count

    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
  • suryaandy
    New Member
    • Feb 2009
    • 3

    #2
    write the following if you want to count the no of rows

    select count(*) from tablename;
    or
    select count(fieldname 1,..) from tablename;

    i hope this help you littlemore...

    Comment

    • Sl1ver
      New Member
      • Mar 2009
      • 196

      #3
      thanx
      used

      row_number() over (order by poh__number) row,

      works perfect

      Comment

      Working...