view_totals.sql 209 B

12345678
  1. CREATE VIEW `view_totals` AS
  2. select
  3. `a`.`invoice_number` AS `invoice_number`,
  4. count(`a`.`line_number`) AS `line_count`,
  5. sum(`a`.`price`) AS `total`
  6. from `invoice_details` a
  7. group by `a`.`invoice_number`