var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to make selection on a temporary created field
I have an SQL query as follows:
MySQL does not accept the query. I need to create the field "yas" dynamically (field actually does not exist) and filter the people whose age is between 1 and 25.
Select bilgiler.*,(year(islemtarihi)-year(dogumtarihi)) as age from bilgiler where age between 1 and 25
Is there a way to do this?
You cannot include the alias name in the where clause. This should be written
select bilgiler.*, (year(islemtarihi)-year(dogumtarihi)) as age
where (year(islemtarihi)-year(dogumtarihi)) between 0 and 25;
I'll try your query. Thanks for your time and help.
FROM ( SELECT bilgiler.*
, year(islemtarihi)-year(dogumtarihi) AS age
FROM bilgiler ) AS d
WHERE age BETWEEN 1 AND 25
I think thats another option. thanks to both of you.