title: MySQL Procedure within a Select?
body: <p>I have a procedure that works like this:</p>
  
  <pre><code>mysql&gt; call Ticket_FiscalTotals(100307);
  +---------+--------+----------+------------+------------+
  | Service | Items  | SalesTax | eTaxAmount | GrandTotal |
  +---------+--------+----------+------------+------------+
  | 75.00   | 325.00 | 25.19    | 8.00       | 433.19     |
  +---------+--------+----------+------------+------------+
  1 row in set (0.08 sec)
  </code></pre>
  
  <p>I would like to call this procedure from within a select, like so:</p>
  
  <pre><code>SELECT     Ticket.TicketID as `Ticket`, 
  Ticket.DtCheckOut as `Checkout Date / Time`,
  CONCAT(Customer.FirstName, ' ', Customer.LastName) as `Full Name`, 
  Customer.PrimaryPhone as `Phone`,
  
  (CALL Ticket_FiscalTotals(Ticket.TicketID)).Service as `Service`
  
  FROM Ticket
  INNER JOIN Customer ON Ticket.CustomerID = Customer.CustomerID 
  ORDER BY Ticket.SiteHomeLocation, Ticket.TicketID
  </code></pre>
  
  <p>However I know that this is painfully wrong.  Can someone please point me in the proper direction?  I will need access to all of the columns from the procedure to be (joined?) in the final Select.  The SQL code within that procedure is rather painful, hence the reason for it in the first place!</p>