Add image metadata columns to your object data file when using ExportToDatabase

Hi there,
My institute recently agreed to install cellprofiler on their cluster and they have set up all the script that allows us to speed up our analysis which is awesome. However, we can only retrieve our data through a SQL database. My problem is that I don’t know how to combine the Per_image table and the Per_object table so that I have the image_metadata columns in my per_object table.
I understand that I may have to write a SQL query using the ImageNumber but that’s about as far as I can figure out what to do.
Does anyone have a generic SQL query that I could use to generate the .csv file of my dream?
Thanks in advance!

Edit: this query seems to do the trick:
I’m now looking for command that specify which column I want to join from the Per_Image table


Others may know better, but one way to work around is to merge the 2 tables Per_Image and Per_Object using the “merge” function in either Python or R, given that they have a column “ImageNumber” in common.

For e.g., I often use Panda merge in Python:
pandas.merge(Per_Image, Per_Object, on=[‘ImageNumber’], how=‘inner’)

Hope it works for you.