Extrafield - Choose from table

Hello everybody,

I have added a custom field to my commercial proposals and invoices.
So far everything worked fine for the beginning with a field of type “Choose from table / Wähle von Tabelle”
and “socpeople:lastname” as a query string.

Now I need to extend the query so that there are ownly shown those contacts in the selection list which
belong to the partner who is chosen for the document.
To get the list that I need in this additional field I would use the following SQL-Statement:

SELECT llx_socpeople_extrafields.bb_obj, llx_socpeople.town, llx_socpeople.firstname, llx_socpeople.lastname, llx_socpeople.poste 
FROM llx_socpeople, llx_socpeople_extrafields, llx_propal 
WHERE llx_propal.rowid = $ID$ AND llx_socpeople.fk_soc = llx_propal.fk_soc AND llx_socpeople.rowid = llx_socpeople_extrafields.fk_object

In the moment I don’t understand how the syntax in the configuration of the additional field works.
Could somebody explain the syntax with : | :: to me? This would be very nice.
I was looking for a better documentation of this dolibarr-Syntax but I didn’t find anything.

Pièces jointes :

I need it too, its very hard.