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. SQL Join

SQL Join

Scheduled Pinned Locked Moved Database
database
4 Posts 2 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.
  • D Offline
    D Offline
    Dayekh
    wrote on last edited by
    #1

    Hi, I have the following tables: Request Table: (RequestID, Request Description, QuoteID) Quote Table: (QuoteID, QuoteNumber) If I have 1 Quote Record. This quote record is assigned to 3 different Requests. I want a VIEW of those tables with a JOIN which will display: vw_QuoteRequest: ================ QuoteID 1 I DO NOT want it to display: vw_QuoteRequest: ================ QuoteID 1 1 1 I hope you see what I mean. Thank you.

    P 1 Reply Last reply
    0
    • D Dayekh

      Hi, I have the following tables: Request Table: (RequestID, Request Description, QuoteID) Quote Table: (QuoteID, QuoteNumber) If I have 1 Quote Record. This quote record is assigned to 3 different Requests. I want a VIEW of those tables with a JOIN which will display: vw_QuoteRequest: ================ QuoteID 1 I DO NOT want it to display: vw_QuoteRequest: ================ QuoteID 1 1 1 I hope you see what I mean. Thank you.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      What else do you want to display? I assume it's not just the QuoteID because if it was, you would just do SELECT DISTINCT QuoteID.

      the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
      Deja View - the feeling that you've seen this post before.

      D 2 Replies Last reply
      0
      • P Pete OHanlon

        What else do you want to display? I assume it's not just the QuoteID because if it was, you would just do SELECT DISTINCT QuoteID.

        the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
        Deja View - the feeling that you've seen this post before.

        D Offline
        D Offline
        Dayekh
        wrote on last edited by
        #3

        Actually I dont want to display anything. I have another table totalling 3: Stage (StageID, StageNumber, ProjectID) Request (RequestID, RequestNumber, RequestDescription, QuoteID) Quote (QuoteID, QuoteNumber) What I need to do is get a link between Quote and Stage. This will also provide a link to the Project Table. I can only obtain this link if I go through the request table. The reason I want this link is because I am querying the table according to projects and stages, which will return a set of Quotes based on that. NOTE: This view will be used as part of another view, therefore this view will not be displaying anything. However, Examining the senario I posted initially, you can see that my view will return 3 instances of the quote because the same quote ID is present in 3 different requests :( I hope this is clear. Please do not hesistate to ask about anything, or even suggest better methods of implementation. Thank you for your time.

        1 Reply Last reply
        0
        • P Pete OHanlon

          What else do you want to display? I assume it's not just the QuoteID because if it was, you would just do SELECT DISTINCT QuoteID.

          the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
          Deja View - the feeling that you've seen this post before.

          D Offline
          D Offline
          Dayekh
          wrote on last edited by
          #4

          Thank you very much for SELECT DISTINCT! It works now =D.

          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