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

Join Problem

Scheduled Pinned Locked Moved Database
databasehelporaclecollaborationjson
3 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.
  • B Offline
    B Offline
    Brian Van Beek
    wrote on last edited by
    #1

    Happy Saint Patrick's Day everyone. I'm stuck here at work, (wish i was watching basketball) but on to my problem. I need to run a query that will return a list of applications. I think I need to do a left join(?) as not all apps will have a person listed. I still need to display the rest of the info though, even if there isn't a person for it. Here is an example what I have so far: (BTW: I'm using oracle 8, and sql is not my specialty "obviously") Select d.application_name, f.first_name, f.last_name, d.servlet_context, d.after_hours_contact, d.context_description, d.database_access, d.test_link, d.notes, e.description, f.user_id, d.app_id, a.team_name from web_team a, web_developers b, web_app_resp_dev c, web_application_info d, web_app_resources e, user_profile f, web_team_lead g where d.team_id = a.team_id and d.app_id = c.app_id and a.team_id = 1 and f.user_id = c.dev_id and (f.user_id = b.dev_id or f.user_id = g.lead_id) and d.app_id = e.app_id order by d.application_name, e.description, f.last_name, f.first_name Brian Van Beek

    B B 2 Replies Last reply
    0
    • B Brian Van Beek

      Happy Saint Patrick's Day everyone. I'm stuck here at work, (wish i was watching basketball) but on to my problem. I need to run a query that will return a list of applications. I think I need to do a left join(?) as not all apps will have a person listed. I still need to display the rest of the info though, even if there isn't a person for it. Here is an example what I have so far: (BTW: I'm using oracle 8, and sql is not my specialty "obviously") Select d.application_name, f.first_name, f.last_name, d.servlet_context, d.after_hours_contact, d.context_description, d.database_access, d.test_link, d.notes, e.description, f.user_id, d.app_id, a.team_name from web_team a, web_developers b, web_app_resp_dev c, web_application_info d, web_app_resources e, user_profile f, web_team_lead g where d.team_id = a.team_id and d.app_id = c.app_id and a.team_id = 1 and f.user_id = c.dev_id and (f.user_id = b.dev_id or f.user_id = g.lead_id) and d.app_id = e.app_id order by d.application_name, e.description, f.last_name, f.first_name Brian Van Beek

      B Offline
      B Offline
      Brian Van Beek
      wrote on last edited by
      #2

      Ooops...I forgot to add a little more info, i need all apps in table "d" even if they don't have a corresponding person in table "c" Brian Van Beek

      1 Reply Last reply
      0
      • B Brian Van Beek

        Happy Saint Patrick's Day everyone. I'm stuck here at work, (wish i was watching basketball) but on to my problem. I need to run a query that will return a list of applications. I think I need to do a left join(?) as not all apps will have a person listed. I still need to display the rest of the info though, even if there isn't a person for it. Here is an example what I have so far: (BTW: I'm using oracle 8, and sql is not my specialty "obviously") Select d.application_name, f.first_name, f.last_name, d.servlet_context, d.after_hours_contact, d.context_description, d.database_access, d.test_link, d.notes, e.description, f.user_id, d.app_id, a.team_name from web_team a, web_developers b, web_app_resp_dev c, web_application_info d, web_app_resources e, user_profile f, web_team_lead g where d.team_id = a.team_id and d.app_id = c.app_id and a.team_id = 1 and f.user_id = c.dev_id and (f.user_id = b.dev_id or f.user_id = g.lead_id) and d.app_id = e.app_id order by d.application_name, e.description, f.last_name, f.first_name Brian Van Beek

        B Offline
        B Offline
        BammBamm
        wrote on last edited by
        #3

        change d.app_id = c.app_id and to d.app_id = c.app_id (+) and

        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