Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2009
    Posts
    1

    Unanswered: compare two tables records using cursour

    I have 2 tables having one common coloumn in both. How can I comapre that the both col conatin same value or not. How can I do this using cursor?
    If any other way to resolve this

    Please help me on that.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    let's say your two tables are called table1 and table2, and the column that they have in common is called columnx

    this query compares the rows without a cursor --
    Code:
    SELECT table1.columnx
         , table2.columnx
      FROM table1
    FULL OUTER
      JOIN table2
        ON table2.columnx = table1.columnx
    ORDER
        BY COALESCE(table1.columnx,table2.columnx)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •