📜  sql 查询在 where 子句中使用 select name - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:52.910000             🧑  作者: Mango

代码示例1
You can not use aliased columns in a WHERE clause. You can try using a derived
table. Perhaps something like this (sorry, not tested):

select tblProgram.POIname from tblProgram
where 
  -- Use this if you only want to filter by the value.
  (select count(*) as alias_name from `fb_promo_codes_used`) < 2