houseofturner
Registered User.
- Local time
- Today, 21:56
- Joined
- Dec 10, 2009
- Messages
- 37
Is there any way that I can perform a function based on a variable within a group. So for example, I have a table with
Make: BMW
model: 5 Series
year: 2014
There might be 5 records like this (for different 5 series derivatives) and 5 where the year is 2015.
I want to combine the model and year but only where there are records with different years.
So for example, if I had 5 records with a model of 5 Series and year of 2015 and no other records I would want to leave the model as 5 Series. But if there was 5 with 2014 and 5 with 2015 I would want to show the model as 5 Series 2014 or 5 Series 2015 (whichever was appropriate).
I can do it with multiple queries but I am trying to do it one as I need to port it across to a mysql database.
Make: BMW
model: 5 Series
year: 2014
There might be 5 records like this (for different 5 series derivatives) and 5 where the year is 2015.
I want to combine the model and year but only where there are records with different years.
So for example, if I had 5 records with a model of 5 Series and year of 2015 and no other records I would want to leave the model as 5 Series. But if there was 5 with 2014 and 5 with 2015 I would want to show the model as 5 Series 2014 or 5 Series 2015 (whichever was appropriate).
I can do it with multiple queries but I am trying to do it one as I need to port it across to a mysql database.