Query to show vendor and products list (MSSQL & PGSQL)

Query to show vendor and products list (MSSQL & PGSQL)

Tested in Build PGSQL (14300) or MSSQL (14306)

Basic details:

select sdo.name "Vendor Name", componentdefinition.componentname "Product", componenttype.componenttypename "Product Type" from vendordefinition 
left join sdorganization sdo on sdo.org_id=vendordefinition.vendorid 
left join componentvendor on componentvendor.vendorid= vendordefinition.vendorid 
left join componentdefinition on componentdefinition.componentid=componentvendor.componentid 
left join componenttype on componenttype.componenttypeid=componentdefinition.componenttypeid

Along with vendor contact details:

select sdo.name "Vendor Name", aci.emailid "Vendor Email ID", apa.DOOR_NO"Door Number",
apa.STREET"Street",
apa.LOCATION"Location",
apa.LANDMARK"Land Mark",
apa.CITY"City",
apa.POSTALCODE"Postal Code",apa.state "State", apa.country "Country", currency.currencyname "Currency", componentdefinition.componentname "Product", componenttype.componenttypename "Product Type" from vendordefinition  left join sdorganization sdo on sdo.org_id=vendordefinition.vendorid 
left join componentvendor on componentvendor.vendorid= vendordefinition.vendorid 
left join componentdefinition on componentdefinition.componentid=componentvendor.componentid 
left join componenttype on componenttype.componenttypeid=componentdefinition.componenttypeid
left join currency on vendordefinition.currencyid=currency.currencyid
left join sdorgcontactinfo sdoc on sdo.org_id=sdoc.org_id
left join aaacontactinfo aci on sdoc.contactinfo_id = aci.contactinfo_id
left join sdorgpostaladdr spa on spa.org_id=sdo.org_id
left join aaapostaladdress apa on apa.POSTALADDR_ID=spa.POSTALADDR_ID
group by sdo.name, aci.emailid, apa.DOOR_NO, apa.STREET,
apa.LOCATION,
apa.LANDMARK,
apa.CITY,
apa.POSTALCODE,apa.state, apa.country, currency.currencyname, componentdefinition.componentname, componenttype.componenttypename  order by sdo.name

                    New to ADSelfService Plus?