PDA

View Full Version : sql request for list client


mccharlet
2nd October 2007, 19:16
Hi,

I want create a list of the client by reseller.
But i don't find wich table use.

Tanks for your help

till
3rd October 2007, 14:40
Resellers: isp_isp_reseller
Clients: isp_isp_kunde

The relations for reseller > client is stored in the table isp_dep

mccharlet
3rd October 2007, 15:54
Tanks Till,

But, I do not find logic in the isp_dep database ant client and reseller.

Wich fields corresponds doc_id from client and reseller

Thanks

till
3rd October 2007, 18:49
It is a classic parent => child record relation. In this case, the reseller is the parent and the client is the child.

isp_dep.parent_doc_id = isp_isp_reseller.doc_id
isp_dep.parent_doctype_id = isp_isp_reseller.doctype_id
isp_dep.child_doc_id = isp_isp_kunde.doc_id
isp_dep.child_doctype_id = isp_isp_kunde.doctype_id

mccharlet
3rd October 2007, 22:58
i don't understand any more

I have a reseller with the doc_id 4. This reseller have five client

If i make a select on the isp_dep database, with the field isp_dep.parent_doc_id with the value 4. i have four recording.
Three with the parent_doctype_id egal 1013 and one with 1012

But nothing with the value 1022 (isp_reseller)

:(

mccharlet
12th October 2007, 11:30
up

Help me