Column not found in Left Join

Viewed 980
    "SELECT `articles`.`name`, `articles`.`description`,`articles`.`startPrice`,`articles`.`creationDate`," 
                        + "`bids`.`date`, `bids`.`price`,`bids`.`userId`"
                        + " FROM `articles` LEFT JOIN `bids` ON `articles`.`id` = `bids`.`articleId`"
                        + " WHERE 1"

java.sql.SQLException: Column '`articles`.`id`' not found.

bids table has not records, but just wanted to try that, since I understand that the Left Join shows all the records in the table on the left although the right table has no records.

I have changed Left Join by Inner Join and the query runs without errors with result of zero records (as expected).

MySql version is 5.7.18

articles table:

enter image description here

Some Test:

Example of a query that work Ok without errors:

"select `articles`.`id`, `articles`.`name`, `articles`.`description`,`articles`.`startPrice`,`articles`.`creationDate`," + 
"`bids`.`date`, `bids`.`price`,`bids`.`userId`"
                                + " FROM `articles` INNER JOIN `bids` ON  `articles`.`id` = `bids`.`articleId` "
                                + " WHERE 1"

I also try to restart my MySql server and the same thing happens

I am using java and JDBC with

statement.executeQuery()
2 Answers
Related