Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql query use select name inside where clause

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
 
PREVIOUS NEXT
Tagged: #sql #query #select #clause
ADD COMMENT
Topic
Name
3+3 =