Error "unknown column usr_id1 in field list" where usr_id1 is an alias generated by dbForge
Posted: Thu 29 Aug 2013 07:35
I am currently running version 6.0.441.
When running the query below, dbForge generates a temporary alias "usr_id1" for column 4 "employment.usr_id" because column 4 has the same name as column 1.
I update the column "employment.title" and submit the update. The update itself is fine but it generates an error "unknown column usr_id1 in field list" when retrieving the row data because dbForge uses the temporary alias `usr_id1` instead of `usr_id` in the query.
Thanks in advance 
When running the query below, dbForge generates a temporary alias "usr_id1" for column 4 "employment.usr_id" because column 4 has the same name as column 1.
Code: Select all
SELECT
usr.usr_id,
usr.name,
usr.email,
employment.usr_id,
employment.title
FROM usr
LEFT OUTER JOIN employment
ON usr.usr_id = employment.usr_id
Code: Select all
UPDATE `company`.`employment` SET `title` = :p1 WHERE (((:p2 = 1 AND `usr_id` IS NULL) OR (`usr_id` = :p3)));
SELECT `usr_id1`, `title` FROM `company`.`employment` WHERE `usr_id` = :p3 AND `title` = :p1
Parameters:
p1: Office Assistant
p2: 0
p3: 12345
