SELECT * FROM `wp_profal_term_relationships`
LEFT JOIN wp_profal_posts
ON wp_profal_posts.ID = wp_profal_term_relationships.object_id
left join wp_profal_postmeta pm on wp_profal_posts.ID = pm.post_id
WHERE wp_profal_posts.post_parent = 0
and wp_profal_posts.post_type = 'product'
and pm.meta_key = '_sku'
and wp_profal_term_relationships.term_taxonomy_id =647
order by meta_value