I'm currently building a query to retrieve some data from my db, I need to access the documents stored in an array, this is how the table
crm_company looks:
+ company_id + documents_avaiable +
- 1 - [71788176,98705180,21468287,...] -
- 2 - [11218494,12825726,10353038,...] -
I have another table for users by document crm_user which looks like this:
+ user_document + email +
- 71788176 - [email protected] -
- 98705180 - [email protected] -
- 11218494 - [email protected] -
What I want as a final result is:
+ user_document + email + company +
- 71788176 - [email protected] - 1 -
- 98705180 - [email protected] - 1 -
I just have tried somehing like the following:
select documents_avaiable[0] from crm_company where crm_company.id = 1
But I'm still unable to retrieve the documents from array.
Thanks in advance for any hint or help.