Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to compare same field in two tables in sql server 2005 using C#

How to compare same field in two tables in sql server 2005 using C#

Scheduled Pinned Locked Moved Database
csharpdatabasesql-serversysadminhelp
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cancerion
    wrote on last edited by
    #1

    Hi, Can anyone help me with small sample for : How to compare same field in two tables in sql server 2005 using C# thanks

    R T 2 Replies Last reply
    0
    • C cancerion

      Hi, Can anyone help me with small sample for : How to compare same field in two tables in sql server 2005 using C# thanks

      R Offline
      R Offline
      RaviRanjanKr
      wrote on last edited by
      #2

      As I getting, you need to get value from two table based on same value. if so then Join Will be better option for your query. Joins allow you to view data from related table in a single result set. you can use any one of Three way of join. Inner Join, Outer Join, Left Join, Move Google for More Information:suss:

      1 Reply Last reply
      0
      • C cancerion

        Hi, Can anyone help me with small sample for : How to compare same field in two tables in sql server 2005 using C# thanks

        T Offline
        T Offline
        thatraja
        wrote on last edited by
        #3

        cancerion wrote:

        compare same field in two tables

        Your question confusing little bit. Based on my guess you may use Alias.(I think you mentioned Same field like same field name in two tables)

        SELECT A.*, B.* FROM TableA AS A, TableB AS B WHERE A.Field1 > B.Field1

        If not then let us know & mention clear details in your question.

        thatraja |Chennai|India|


        Brainbench certifications
        Down-votes are like kid's kisses don't reject it :-)
        Do what you want quickly because the Doomsday on 2012 :-)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups