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. inner join results

inner join results

Scheduled Pinned Locked Moved Database
databasecomhelp
3 Posts 3 Posters 4 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.
  • U Offline
    U Offline
    User 13834889
    wrote on last edited by
    #1

    Hi, I have below query which giving 8 records. declare @t table (id int) declare @t2 table(id2 int) insert into @t values(1),(1),(1) insert into @t2 values(1),(1),(1) select t1.id from @t t1 inner join @t2 t2 on t1.id=t2.id2 I think we should get 9 records. Please help Thanks

    Richard DeemingR V 2 Replies Last reply
    0
    • U User 13834889

      Hi, I have below query which giving 8 records. declare @t table (id int) declare @t2 table(id2 int) insert into @t values(1),(1),(1) insert into @t2 values(1),(1),(1) select t1.id from @t t1 inner join @t2 t2 on t1.id=t2.id2 I think we should get 9 records. Please help Thanks

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      That code produces 9 records here. There must be something else going on. Execute your query in a new SSMS query document. Try adding SET ROWCOUNT 0 at the top, just in case you've picked up some weird settings from somewhere.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • U User 13834889

        Hi, I have below query which giving 8 records. declare @t table (id int) declare @t2 table(id2 int) insert into @t values(1),(1),(1) insert into @t2 values(1),(1),(1) select t1.id from @t t1 inner join @t2 t2 on t1.id=t2.id2 I think we should get 9 records. Please help Thanks

        V Offline
        V Offline
        Victor Nijegorodov
        wrote on last edited by
        #3

        I tested your script in SSMS-2017. It gives me 9 records. BTW, perhaps you should scroll the "result" window to see the last row?

        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