title: Using select on the same attribute twice
body: <p>Let's say I have a database initialized like this:</p>
  
  <pre><code>Players{
  Pid int primary key,
  tid int not null references Teams,
  name text not null,
  age int not null
  }
  
  Teams{
  tid int primary key,
  name text not null,
  location not null
  }
  
  Possessions{
  id int primary key,
  pid int not null references Players,
  time timestamp not null, //the time the possession started for a player
  held int not null //for how much time he had the ball
  }
  </code></pre>
  
  <p>I would like to create a view called Teampasses where I can select <code>(passer,passee)</code> as follows:Passer and passe must be from the same team and passes possession starting time equals to passes possession starting time +held (time he has the ball). What I have done so far is this:</p>
  
  <pre><code>CREATE VIEW TeamPasses AS
  SELECT PL.name AS P1,PL.name as P2
  FROM Players as PL,Possessions as PO,Teams as T
  Where P2.PO.time=P1.PO.time+P1.PO.held AND P2.T.tid=P1.T.tid
  </code></pre>
  
  <p>What I would like to ask is this: Is this <code>P2.PO.time</code> valid?
  If not how could this be done correctly?</p>