O$: How to use $selectdistinct?

Andy Hilton andyh at totallybrilliant.com
Thu Dec 2 07:53:58 EST 2010


My experience also - you can't pass the column you want as a parameter, but what you can pass is the 'where' clause which defines which records to look at in determining the result that you will get......

Andy


On Dec 2, 2010, at 3:41 AM, Jonathan Rumbold wrote:

> Hi Rob,
> 
> I'm thinking you might need a query class with RATELOCATION as the only column defined, then define your list from that class then do your $selectdistinct. The distinct looks at ALL the columns in the select.
> 
> Regards,
> 
> Jonathan Rumbold
> 
> Omni Potent Solutions P/L
> Highlands 3660, Australia.
> 03 5796 9344
> 0408 969399
> www.omnipotent.com.au
> 
>> -----Original Message-----
>> From: omnisdev-en-bounces at lists.omnis-dev.com [mailto:omnisdev-en-
>> bounces at lists.omnis-dev.com] On Behalf Of Rob Brandt
>> Sent: Thursday, 2 December 2010 6:13 PM
>> To: omnisdev-en at lists.omnis-dev.com
>> Subject: Re: O$: How to use $selectdistinct?
>> 
>> Yes, $select works just fine. And $selectdistinct without parameters
>> works too, except it doesn't know what I want to be "distinct", so it
>> returns most if not all of the data (1300 records).  There are really
>> only 4 distinct values currently in the RATELOCATION COLUMN.
>> 
>> Rob
>> 
>> 
>> On 12/1/10 11:05 PM, George Panagopoulos wrote:
>>> Hi Rob,
>>> 
>>> Check if a regular $select in the same code gives correct results.
>>> Normally $select and $selectdistinct work exactly the same.
>>> Also try to catch the SQL text that is issued to the database server( on
>>> an OK message). Maybe there is some syntax error there.
>>> 
>>> I hope it helped.
>>> 
>>> George
>>> 
>>> Στις 2/12/2010 3:44 πμ, ο/η Rob Brandt έγραψε:
>>>> I have a need to build a list of distinct values from one column in a
>>>> table. In plain ol' mysql I can get the results I want with:
>>>> 
>>>> SELECT DISTINCT `RATELOCATION` FROM `newmainclientpayments`
>>>> 
>>>> Where RATELOCATION is the column among 30 columns from the table I
>> need.
>>>> 
>>>> Seems like it should be something like
>>>> 
>>>> Do
>>>> 
>> iRateLocationList.$definefromsqlclass($libs.COMMON.$tables.T_NewMainClien
>> tPayments)
>>>> 
>>>> 
>>>> Do iRateLocationList.$selectdistinct('RATELOCATION')
>>>> Do iRateLocationList.$fetch(kFetchAll)
>>>> 
>>>> But it results in an error. I also tried creating a 1 column schema
>>>> and defining the list with that class, then using $selectdistinct with
>>>> no parameters, which resulted in no data.
>>>> 
>>>> TIA
>>>> 
>>>> Rob
>>>> _____________________________________________________________
>>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>>> 
>>>> 
>>> 
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list