-
selam erdem
i had such a problem years ago, i have solved it using sql functions and calling those functions in select query..
but i did it on Postgresql, so i am not sure it is fully compatible with mysql, anyway at least it gives you an idea..
this is what i would do on postgres--
create sql functions that returns the value of given year.. get_value(year, it_id)
ex:
create function get_value( varchar, int) returns
varchar as 'select value from table where year=''$1'' it_id=''$2'' ' language 'sql';
and run this query..
select year, get_value(year, 10), get_value(year, 11) from table group by year ;
i think it gives you
1998 value_10 value_11
2000 value_10 value_11
try mysql equivalent of this, i hope it works..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|