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. query..

query..

Scheduled Pinned Locked Moved Database
database
4 Posts 3 Posters 0 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.
  • V Offline
    V Offline
    vishal v patil
    wrote on last edited by
    #1

    i want the SQL query for getting single column from two different tables column.... i have two tables...vendor and labour, In that Vendor_Name and Labour_name columns.. i want all names in one single column... Thnks....

    Vishal V Patil (M. C. A.)

    M 1 Reply Last reply
    0
    • V vishal v patil

      i want the SQL query for getting single column from two different tables column.... i have two tables...vendor and labour, In that Vendor_Name and Labour_name columns.. i want all names in one single column... Thnks....

      Vishal V Patil (M. C. A.)

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Do some reading around the UNION keyword.

      Select Vendor_Name from Vendor
      UNION
      Select Labour_Name from Labour

      Never underestimate the power of human stupidity RAH

      V 1 Reply Last reply
      0
      • M Mycroft Holmes

        Do some reading around the UNION keyword.

        Select Vendor_Name from Vendor
        UNION
        Select Labour_Name from Labour

        Never underestimate the power of human stupidity RAH

        V Offline
        V Offline
        vishal v patil
        wrote on last edited by
        #3

        Thnks for rply....but, It will show last two records from both two tables....

        Vishal V Patil (M. C. A.)

        B 1 Reply Last reply
        0
        • V vishal v patil

          Thnks for rply....but, It will show last two records from both two tables....

          Vishal V Patil (M. C. A.)

          B Offline
          B Offline
          Blue_Boy
          wrote on last edited by
          #4

          select * from vendor where id in (select top 2 id from vendor order by id desc)
          union all
          select * from labour where id in (select top 2 id from labour order by id desc)


          I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.

          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