|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
oracle 9i complex join
Hi all, and thanks for reading.
Because our system has incorrect Canadian postal codes whereas our credit processor requires the correct codes, I've been forced to create a transpose table. I've gotten the best results using this query: SELECT S_ABBREV,S_NAME,CSCODE,STATE_NAME FROM FSTATE,PARKING.STATE_TRANSPOSE WHERE T2CODE(+)=S_ABBREV ORDER BY S_ABBREV,CSCODE FSTATE is the system table with the incorrect codes STATE_TRANSPOSE is my table with the correct codes S_ABBREV is the code field from the system table T2CODE is the corresponding field with the incorrect code CSCODE is the field with the correct code S_NAME and STATE_NAME contain the province names The problem with the data is that it does not return a row if there is not a T2CODE corresponding to the S_ABBREV. However, because the system table outright excludes many Canadian provinces, there are some where there is no T2CODE but there is a CSCODE that I need a record returned for. So why do a join at all? I need the T2CODE to correspond to the S_ABBREV record when there is a T2CODE so that I can get the correct province code. Make sense? I hope that's not too confusing. Feel free to PM me if you have questions. And thanks in advance for any help. -colin |
|
#2
|
||||
|
||||
|
Please move this thread to the appropriate forum.
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > oracle 9i complex join |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|