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



Oops, missed one:

SELECT TISEQ FROM tapeinv00 WHERE (titapedate, tisystem, TILabel, tilocate) IN (select
max(titapedate), tisystem, TILable, tilocate from tapeinv00 where tisystem = 'RG' and TIlabel =
'FRIDAY' and tilocate = 'VAULT' )

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of Dan Kimmel
Sent: Tuesday, November 26, 2013 1:42 PM
To: Midrange Systems Technical Discussion
Subject: RE: sql max help

Another way around is a multiple column subquery:

SELECT TISEQ FROM tapeinv00 WHERE (titapedate, TILabel, tilocate) IN
(select
max(titapedate), TILable, tilocate from tapeinv00 where tisystem = 'RG'
and TIlabel =
'FRIDAY' and tilocate = 'VAULT' )

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike
Sent: Tuesday, November 26, 2013 1:01 PM
To: Midrange Systems Technical Discussion (midrange-l@xxxxxxxxxxxx)
Subject: sql max help

I have a table with the following
TISYSTEM TILABEL TILOCATE TISEQ TITAPEDATE
RG FRIDAY VAULT 1 20,130,614
RG FRIDAY VAULT 2 20,130,524
RG FRIDAY VAULT 3 20,130,531
RG FRIDAY VAULT 4 20,130,607
RG MONDAY VAULT 1 20,130,614
RG MONDAY VAULT 2 20,130,524
RG MONDAY VAULT 3 20,130,531
RG MONDAY VAULT 4 20,130,607

I am trying to get the value of TISEQ for the record with the highest date for
a
specific system, label, location

So I have the following query and it works fairly well, except I seem to get
two records back

SELECT TISEQ FROM tapeinv00 WHERE titapedate = (select
max(titapedate) from tapeinv00 where tisystem = 'RG' and TIlabel =
'FRIDAY' and tilocate = 'VAULT' )

What I would hope to get for this query is 1
I get two records with 1 returned and I'm not sure why.
Ideas?
Better way to do this query?

Thanks

Mike



NOTICE: This message, including any attachment, is intended as a
confidential
and privileged communication. If you have received this message in error,
or
are not the named recipient(s), please immediately notify the sender and
delete this message.
--
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.