|
Actually no it won't.
Select distinct fld1, fl2
from file
would give one row in the results set for every combination of fld1,
fld2
Select fld1, fl2
from file
group by fld1, fld2
would give you as many rows as the original table, with duplicates for
the rows with the same fld1, fld2.
In order for a solution using GROUP BY to work, you also need an
aggregate function of some sort...
Select fld1, fl2, count(*) as theCount
from file
group by fld1, fld2
HTH,
Charles
On Mon, Jul 26, 2010 at 2:33 PM, Schutte, Michael D
<Michael_Schutte@xxxxxxxxxxxx> wrote:
One suggestion...bounces@xxxxxxxxxxxx] On Behalf Of Loyd Goodbar
Do a select group by query versus a select distinct.
Select fld1, fld2
From fileGroup by fld1, fld2
Would give the same requests as
Select distinct fld1, fld2
Just try to see if VE gives a different answer.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
Sent: Monday, July 26, 2010 2:25 PMqualifier in
To: Midrange Systems Technical Discussion
Subject: Re: Using an SQL index over DDS file?
Thanks for the replies.
Luis, index advisor does not recommend any indexes. If I put a
the select, such as "where i1azcd='WV'", VE shows the index in usebut the
run time is the same, between 60 and 90 seconds. I was hoping thatsince I
select only the columns from the index it would perform much faster.As to
any gotchas, I was referring akin to runtime performance: will thequery
perform differently because I call it from iNav or STRSQL or embedded?suggested, I
Michael, I try to create new database objects with SQL. As you
created a logical file. However, even selecting directly against theLF, VE
reports a table scan is performed.Running the
Charles, there are 14 indexes on the table, including this one.
query with STRDBG and STRSQL did not yield any messages or indexadvice. VE
reported the query optimizer did not time out. It reports "Indexesexist but
none could be used".refuses to
I can't do more testing until I reboot, as Run SQL Scripts now
run scripts or VE.mailing list
Thanks again,
Loyd
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
To post a message email: MIDRANGE-L@xxxxxxxxxxxxmailing list
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.