SELECT tbl158.FIO_Name, tbl158.FIO_ID,tbl157.FIO_Name, tbl157.FIO_ID,tbl159.FIO_Name, tbl159.FIO_ID,tbl160.FIO_Name, tbl160.FIO_ID,tbl161.FIO_Name, tbl161.FIO_ID,tbl162.FIO_Name, tbl162.FIO_ID,tbl163.FIO_Name, tbl163.FIO_ID,tbl164.FIO_Name, tbl164.FIO_ID,tbl165.FIO_Name, tbl165.FIO_ID,a.An1,a.Nazv,a.Izd,a.Mesto_p,a.Publ,a.Date, DATE_FORMAT(a.Date,'%Y'), DATE_FORMAT(a.Date,'%m'), DATE_FORMAT(a.Date,'%d'), DATE_FORMAT(a.Date,'%H'), DATE_FORMAT(a.Date,'%i'), DATE_FORMAT(a.Date,'%s'),a.Nn,a.Str,tbl289.Publ_Name, tbl289.Publ_ID,a.Doclad,a.TextPub,a.Description,a.Keywords,a.Url,a.Message_ID, a.User_ID, a.IP, a.UserAgent, a.LastUser_ID, a.LastIP, a.LastUserAgent, a.Priority,a.Checked, a.Created, a.LastUpdated FROM Message24 AS a ,Message18 AS c LEFT JOIN Classificator_FIO AS tbl158 ON a.A1=tbl158.FIO_ID LEFT JOIN Classificator_FIO AS tbl157 ON a.A2=tbl157.FIO_ID LEFT JOIN Classificator_FIO AS tbl159 ON a.A3=tbl159.FIO_ID LEFT JOIN Classificator_FIO AS tbl160 ON a.A4=tbl160.FIO_ID LEFT JOIN Classificator_FIO AS tbl161 ON a.A5=tbl161.FIO_ID LEFT JOIN Classificator_FIO AS tbl162 ON a.A6=tbl162.FIO_ID LEFT JOIN Classificator_FIO AS tbl163 ON a.A7=tbl163.FIO_ID LEFT JOIN Classificator_FIO AS tbl164 ON a.A8=tbl164.FIO_ID LEFT JOIN Classificator_FIO AS tbl165 ON a.A9=tbl165.FIO_ID LEFT JOIN Classificator_Publ AS tbl289 ON a.Type=tbl289.Publ_ID LEFT JOIN Subdivision AS sub ON sub.Subdivision_ID=a.Subdivision_ID LEFT JOIN Sub_Class AS cc ON cc.Sub_Class_ID=a.Sub_Class_ID WHERE 1=1 AND (c.Depart=12 AND (
a.A1=c.PIN||a.A2=c.PIN||a.A3=c.PIN||a.A4=c.PIN||a.A5=c.PIN||
a.A6=c.PIN||a.A7=c.PIN||a.A8=c.PIN||a.A9=c.PIN)) AND a.Checked=1 AND a.Message_ID=1151
Query failed (1054): Unknown column 'a.A1' in 'on clause'