Map Views fields from custom query
One solution I found is to add PHP fields for the data you want to present into the view. The variable $data that holds what was retrieved from the database, per row, is printed this way:

print $data-&gt;[alias];


Where [alias] is the field alias from the database, without the brackets (ex. in $sql-&gt;addField('n', 'title', 'node_title') the alias is node_title).

This solution is not as clean as I would like so I will wait for more, "cleaner" answers before accepting this one.