Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 12th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to match two tables with different primary key lengths
  2. SELECT domainregion.domainid, dyndomrun.ddid
  3. FROM domainregion, dyndomrun
  4. WHERE domainregion.domainid = dyndomrun.ddid
  5. ORDER BY domainregion.domainid, dyndomrun.ddid;
  6.        
  7. select *
  8.   from t1
  9.      , t2
  10.  where to_char(t1.id) = substr(t2.id,1,4)
  11.        
  12. select *
  13.   from t1
  14.      , t2
  15.  where t1.id = round(t2.id/10)
  16.        
  17. SELECT *
  18.   FROM person
  19.  INNER JOIN department ON person.personid = LEFT(department.personid,4)