Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread LIST
Wed, May 20 2009 9:57 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Any way to accomplish this

select list(select distinct _companyname from invoices order by _companyname) from invoices

I get

ElevateDB Error #1011 An error occurred with the query  SELECT DISTINCT "_companyname" AS "_companyname" FROM "invoices" ORDER BY "_companyname" (A scalar query can only return a single value)

Roy Lambert
Thu, May 21 2009 3:27 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Any way to accomplish this

select list(select distinct _companyname from invoices order by
_companyname) from invoices

I get

ElevateDB Error #1011 An error occurred with the query SELECT DISTINCT
"_companyname" AS "_companyname" FROM "invoices" ORDER BY "_companyname" (A
scalar query can only return a single value) >>

What you want is this (derived table):

select list(_companyname) as CompanyName
from (select distinct _companyname from invoices order by _companyname) AS
DistinctCompany

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, May 22 2009 3:16 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Dammit - never thought of trying the derived table OUTSIDE of the LIST()

Thanks

Roy Lambert
Image