Siebel SQLs/Error Messages >  Accounts and Sub entity links

All opportunities in one account
select o.name, o.row_id from s_org_ext a, s_opty o
where a.row_id = o.pr_dept_ou_id
and a.row_id = 'account row_id';
Account Status - CUST_STAT_CD column of s_org_ext
List of opportunities of account in status Active/Prospect or Suspect
select a.row_id,o.row_id from s_org_ext a, s_opty o
where a.row_id = o.pr_dept_ou_id
and a.CUST_STAT_CD = 'Active'
group by o.row_id, a.row_id;
Link between Account and Position
Tables s_org_ext is linked to table s_accnt_postn which is linked to s_postn
s_org_ext.row_id = s_accnt_postn.ou_ext_id
and s_org_ext.name = s_accnt_postn.accnt_name
and s_accnt_postn.position_id = s_postn.row_id
Link between Account and address
ACCNT_ID of S_CON_ADDR is linked to row_id of s_org_ext
Link between contact and account
PR_DEPT_OU_ID of s_contact = row_id of s_org_ext
Link between account and audit trail
Row_id of s_org_ext = record_id of s_audit_item