i'm really confused in how to do this in mysql and if it's possible at all. I have a table where i need to select articles which have id = idi:
$query->select('title, id, idi, introtext');
$query->from('#__content');
$query->where('idi = ' . $id);
So, now component shows main article ( id ) and extra articles which has same IDI as ID.
__content table
ID IDI
0 0
1 0
2 1
3 1
So, article with ID 1 will have extra articles with ID 2,3 because IDI is 1. ID=IDI
And now i need to get extra articles voting_results from table ratings where votings_results ID are equal to #__content id.
__ratings table
ID voting_result1
0 55
1 123
2 64 <--
3 42 <--