0

I have the following select query:

SELECT     `tbl_calendar`.`id_tech` count(`tbl_calendar`.`id_tech`) AS scheduled , 
           ( 
                     SELECT    `tbl_calendar`.`id_tech` , 
                               `tbl_client`.`c_name`           AS name , 
                               count(`tbl_calendar`.`id_tech`) AS quantity 
                     FROM      `tbl_calendar` 
                     LEFT JOIN `tbl_client` 
                     ON        ( 
                                         `tbl_calendar`.`id_tech` = `tbl_client`.`id_client`) 
                     LEFT JOIN `tbl_service_report` 
                     ON        ( 
                                         `tbl_service_report`.`id_service_case` = `tbl_calendar`.`id_service_case`)
                     WHERE     `tbl_service_report`.`timeout` !='') 
FROM       `db_pm`.`tbl_service_case` 
INNER JOIN `db_pm`.`tbl_calendar` 
ON         ( 
                      `tbl_service_case`.`id_service_case` = `tbl_calendar`.`id_service_case`) 
INNER JOIN `db_pm`.`tbl_service_report` 
ON         ( 
                      `tbl_service_case`.`id_service_case` = `tbl_service_report`.`id_service_case`) AS finished
GROUP BY   `tbl_calendar`.`id_tech`

Needed Output:

|----|-----------|----------|
| ID | Scheduled | Finished |
|----|-----------|----------|
| 1  | 2         | 1        |
|----|-----------|----------|

but the result is
Operand should contain 1 column(s)

Please help

cSteusloff
  • 2,487
  • 7
  • 30
  • 51
Paz Cruz
  • 1
  • 1

0 Answers0