view_analysis.sql 474 B

1234567891011121314151617
  1. SELECT a.*,
  2. b.name as `seller_name`,
  3. concat('Kasse ', a.pos_id) as `pos_name`,
  4. left(a.invoice_date, 10) as `date_1`,
  5. concat(left(a.invoice_date, 13), ':00') as `date_2`,
  6. concat(left(a.invoice_date, 15), '0') as `date_3`,
  7. left(a.invoice_date, 16) as `date_4`,
  8. replace(cast(a.price as char), '.',',') as `price_string`,
  9. replace(cast(a.total as char), '.',',') as `total_string`,
  10. '1' as quantity
  11. FROM `view_invoices` a
  12. LEFT JOIN `sellers` b ON a.seller_id = b.seller_id