Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.47 KB | None | 0 0
  1. SELECT tle.tle_id, tle.bezeichnung, lfr.lfr_id
  2. FROM  g1_tle tle
  3. LEFT JOIN g1_tll tll
  4.     ON tle.tle_id = tll.teil
  5. LEFT JOIN g1_lfr lfr
  6.     ON tll.lieferant = lfr.lfr_id
  7. WHERE lfr.sperre IS NOT NULL AND
  8.  
  9. (SELECT t.lieferant
  10.       FROM G1_TLL t, G1_LFR l
  11.       WHERE t.lieferant = l.lfr_id AND teil = tle.tle_id AND
  12.       (SELECT MIN(prioriaet) FROM G1_TLL t, G1_LFR l
  13.       WHERE teil = tle.tle_id AND t.lieferant = l.lfr_id AND l.sperre IS NULL) = t.prioriaet) IS NULL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement