天天看點

oracle中字段别名帶引号引發的辨別符無效報錯

–正常,别名使用引号且為大寫,最外層select語句where條件不帶雙引号時,字段名可大寫可小寫

select * from (select id as “IDD” from tableName) where idd = 1;

–正常,别名使用引号且為大寫,最外層select語句where條件不帶雙引号時,字段名可大寫可小寫

select * from (select id as “IDD” from tableName) where IDD = 1;

–正常,别名使用引号且為大寫,最外層select語句where條件帶雙引号時,字段名必須與别名相同

select * from (select id as “IDD” from tableName) where “IDD” = 1;

–報錯辨別符無效,别名使用雙引号且為大寫,最外層select語句where條件帶雙引号時,字段名必須與别名相同

select * from (select id as “IDD” from tableName) where “idd” = 1;