sql - MYSQL ERROR: unknown table `airports` -


i trying run following query:

select `aalv_test`.`aircraft`.*, `aalv_test`.`airports`.*, `aalv_test`.`bids`.*  `bids`  left join `aalv_test`.`pilots` on `bids`.`pid` = `pilots`.`id`  left join `aalv_test`.`schedules` on `bids`.`fid` = `schedules`.`id` left join `aalv_test`.`aircraft` on `schedules`.`aircraft` = `aircraft`.`id`  left join `aalv_test`.`airports` `arr` on `schedules`.`arricao` = `arr`.`icao` left join `aalv_test`.`airports` `dep` on `schedules`.`depicao` = `dep`.`icao`  `pilots`.`id` = 419 

however, mysql returns error #1051 - table airports not exist. don't know issue , google hasn't helped. ideas? also, if use 1 alias, 1 airport need both. , data in table airports according query, not exist. also, if try throwing section in select clause, error 1064: syntax error near as.

edit: database name aalv_test, .* @ end specifies use fields in table, , middle part table name, yes chaining fields.

try this:

select a.*, arr.*, dep.*, b.*  bids b  left join aalv_test.pilots p on b.pid = p.id  left join aalv_test.schedules s on b.fid = s.id left join aalv_test.aircraft on s.aircraft = a.id  left join aalv_test.airports arr on s.arricao = arr.icao left join aalv_test.airports dep on s.depicao = dep.icao  p.id = 419; 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -