× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I usually agree with your SQL advice, Charles, but in this case my
experience differs.

SELECT PRSTAT, PRTYPE FROM PRPMS GROUP BY PRSTAT, PRTYPE ;
SELECT COUNT(*) FROM PRPMS ;

The first statement will return 37 rows on this system, none of which are
duplicates.
The second returns a value of 11,321.

The way I read your reply, I should expect 11,321 rows returned in the first
query.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
?...Yes, the lectures are optional. Graduation is also optional.?
-- Professor Brian Quinn


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...

Do a select  group by query versus a select distinct.

Select  fld1, fld2
From file
Group 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-
bounces@xxxxxxxxxxxx] On Behalf Of Loyd Goodbar
Sent: Monday, July 26, 2010 2:25 PM
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
qualifier in
the select, such as "where i1azcd='WV'", VE shows the index in use
but the
run time is the same, between 60 and 90 seconds. I was hoping that
since 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 the
query
perform differently because I call it from iNav or STRSQL or embedded?

Michael, I try to create new database objects with SQL. As you
suggested, I
created a logical file. However, even selecting directly against the
LF, VE
reports a table scan is performed.

Charles, there are 14 indexes on the table, including this one.
Running the
query with STRDBG and STRSQL did not yield any messages or index
advice. VE
reported the query optimizer did not time out. It reports "Indexes
exist but
none could be used".


I can't do more testing until I reboot, as Run SQL Scripts now
refuses to
run scripts or VE.

Thanks again,
Loyd
--
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.

--
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.


--
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.