![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Knowledge Base Most common error and how to trouble shoot them off |
![]() |
|
Oracle select with sub select not working
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Administrator
Posts: 875
Join Date: Oct 2005
Rep Power: 10
IM:
|
select distinct STATE_lookup.STATE, state_fullname from STEO.ADOPT_STATE, STEO.STATE_LOOKUP where STATE_LOOKUP.STATE NOT IN (select STATE from adopt_state) and state_lookup.state <> 'DC' and state_lookup.state <> 'US' order by state_fullname Solution: select distinct sl.STATE, sl.state_fullname from STEO.STATE_LOOKUP sl where sl.STATE NOT IN (select STATE from adopt_state) and sl.state <> 'DC' and sl.state <> 'US' order by sl.state_fullname and SELECT DISTINCT sl.state, sl.state_fullname FROM STEO.STATE_LOOKUP AS sl WHERE sl.state NOT IN (SELECT state FROM STEO.adopt_state) AND sl.state <> 'DC' AND sl.state <> 'US' ORDER BY sl.state_fullname or select state, state_fullname from state_lookup l where not exists (select 1 from adopt_state a where a.state = l.state) and state <> 'DC' and state <> 'US' order by state_fullname; |
|
|
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|