title: PTC WindChill query reads deleted links too
body: <p>I'm trying to query a WindChill database to get all child parts of a given part (assembly). What I have right now is this:</p>
  
  <pre><code>-- this is how sql server management studio rewrites an oracle join
  SELECT    M1.WTPARTNUMBER AS COMPONENT, M2.WTPARTNUMBER AS ASSEMBLY, MAX(WTPARTUSAGELINK.AMOUNTA7) AS AMOUNT
  FROM      WTPART, WTPARTMASTER M2, WTPARTUSAGELINK, WTPARTMASTER M1
  WHERE     WTPART.IDA3MASTERREFERENCE = M2.IDA2A2 
                     AND WTPART.IDA2A2 = WTPARTUSAGELINK.IDA3A5
                     AND WTPARTUSAGELINK.IDA3B5 = M1.IDA2A2
  GROUP BY  M2.WTPARTNUMBER, M1.WTPARTNUMBER
  order by  M2.WTPARTNUMBER, M1.WTPARTNUMBER
  </code></pre>
  
  <p>It works in the sense that I get a list of every assembly and its parts, which I can later filter when building my tree. This is perfectly fine, there's like 1k assemblies total.</p>
  
  <p>The problem is that I also get lines I deleted from WindChill (they don't show in the WindChill web app). I realize this is a long shot, but is there another table I need to join or something to get whether or not to actually include a potential child part?</p>