SQL Server distinct not being used properly -
SQL Server distinct not being used properly -
i'm trying select 1 business relationship using sql server getting next error:
error: text info type cannot selected distinct because not comparable. error code: 421
with next statement:
select distinct ad.*, acc.companyname, acc.accountnumber address advertisement bring together addresslink al on al.addressid = ad.id bring together business relationship acc on acc.id = al.parentid acc.accountnumber '11227'
what have done wrong?
edit:new query:
select address.id, address.streetaddress1, address.streetaddress2, address.city, address.state, address.postalcode, address.classtypeid, account.companyname, account.accountnumber, addresslink.id addresslinkid, addresslink.addresstypeid address bring together addresslink on address.id = addresslink.addressid bring together business relationship on addresslink.parentid = account.id account.companyname 'company name'
all company names i've had blur identical.
try:
select ad.*, l.companyname, l.accountnumber address advertisement bring together (select distinct al.addressid, acc.companyname, acc.accountnumber business relationship acc bring together addresslink al on acc.id = al.parentid acc.accountnumber '11227') l on l.addressid = ad.id
sql sql-server
Comments
Post a Comment