Hi,
I have a customer table that has a column (Customer age). I also have a reference table that has an age range and based on where the customer age falls, it identifies an age_Group.
I need to know how to do this through SQL.
Here is what I am trying to do
I tried following, but it didn't work.
SELECT
c.*,
RT_C.Age_group
from
tbl_customer c
join
tbl_age RT_C
on
c.Customer_age between RT_C.Age_from and RE_C.Age_to;
I've attached the DB for reference.
Thanks in advance
I have a customer table that has a column (Customer age). I also have a reference table that has an age range and based on where the customer age falls, it identifies an age_Group.
I need to know how to do this through SQL.
Here is what I am trying to do
I tried following, but it didn't work.
SELECT
c.*,
RT_C.Age_group
from
tbl_customer c
join
tbl_age RT_C
on
c.Customer_age between RT_C.Age_from and RE_C.Age_to;
I've attached the DB for reference.
Thanks in advance