How to do a JOIN in Oracle SQL? -


i have 2 tables users , user_org.

  • users ( user_id,first name,last name, active_ind, email)
  • user_org (user_id, org_id)

i have write oracle sql query, should return users active_ind 1 , org_id of associated user in user_org match given org_id.

i have tried below, not working

select * users u   join user_org  org         org.organization_id = 12345    , active_ind != 0; 

you missing on clause of join. other that, if want users active_ind of 1, i'd state directly equality check (=) instead of dancing around inequality check.

select u.*  users u join  user_org org on u.user_id = org.user_id org.org_id = 12345 , active_ind = 1 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -