Enough on this one I think, I'm gettin a headache. As always, thanks.
-----Original Message-----
From: Needles,Stephen J <SNEEDLES@xxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Sent: Mon, Sep 9, 2013 11:52 am
Subject: RE: SQL question
This might get you onto a path (right or wrong... :-) )
SELECT odldat, count(*) FROM mylib.objstuff GROUP BY ODldat
nion
ELECT 999999, count(*) FROM mylib.objstuff
rder by 1
Change COUNT ( * )
ate
0,512 1
2,313 2
1,113 1
2,013 6
2,213 127
2,813 1
1,313 1
80,113 1
81,413 2
82,012 2
82,313 2
83,013 3
83,113 1
91,712 1
92,712 1
92,812 2
00,212 1
99,999 210
teve Needles
----Original Message-----
rom: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx]
n Behalf Of fbocch2595@xxxxxxx
ent: Monday, September 09, 2013 10:47 AM
o: midrange-l@xxxxxxxxxxxx
ubject: Re: SQL question
i Buck, that statement gave me;
oken , was not valid. Valid tokens: < > = <> <= !< !> != >= ¬< ¬> ¬
SELECT odobnm, odldat, odltim FROM myfile
here odldat = 090713 or odldat, 0 as total = 090813
nion
elect 'TOTAL', 9999999, 0, count(*) as total from myfile
here odldat = 090713 or odldat = 090813
rder by 2
SELECT odobnm, odldat, odltim FROM myfile here odldat = 090713 or odldat, 0 as
otal = 090813 nion elect 'TOTAL', 9999999, 0, count(*) as total from myfile
ere odldat = 090713 or odldat = 090813 rder by 2
-----Original Message-----
rom: Buck Calabro <kc2hiz@xxxxxxxxx>
o: midrange-l <midrange-l@xxxxxxxxxxxx>
ent: Mon, Sep 9, 2013 11:41 am
ubject: Re: SQL question
n 9/9/2013 9:23 AM, Frank wrote:
Hi Folks, when I use the following statement I get a list of files but now I
nt to know the count or total of the odobnm's in the query...what's the syntax
r that or how can I get that number within by adding to the select statement?
Thanks, Frank
SELECT odobnm, odldat, odltim FROM myfile
where odldat = 090713 or odldat = 090813
order by odldat
i Frank,
LECT isn't really like Query. SELECT wants to create a table. That
ans it wants all the columns to mean the same thing. The first column
the object name, the second column is the change date, the third
lumn is the change time. With this file layout, which column would
ld the count?
here is a way to coerce SELECT into combining two tables into one -
ION. UNION wants to combine two identically formatted tables into
e. That means we need to add a column to hold the total. In the
tail table, we can use 0 as a place holder column in the SELECT. In
e total table, we need place holders for all the other columns.
nally, because we want the total to sort at the end, we can put a
rge value in the column that's being sorted. When the UNION combines
e detail and total tables, the ORDER BY will sort the large-value
tal at the end.
ELECT odobnm, odldat, odltim FROM myfile
ere odldat = 090713 or odldat, 0 as total = 090813
ion
lect 'TOTAL', 9999999, 0, count(*) as total from myfile
ere odldat = 090713 or odldat = 090813
der by 2
--buck
is is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
post a message email: MIDRANGE-L@xxxxxxxxxxxx
subscribe, unsubscribe, or change list options,
sit:
http://lists.midrange.com/mailman/listinfo/midrange-l
email: MIDRANGE-L-request@xxxxxxxxxxxx
fore posting, please take a moment to review the archives
http://archive.midrange.com/midrange-l.
--
his is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
o post a message email: MIDRANGE-L@xxxxxxxxxxxx
o subscribe, unsubscribe, or change list options,
isit:
http://lists.midrange.com/mailman/listinfo/midrange-l
r email: MIDRANGE-L-request@xxxxxxxxxxxx
efore posting, please take a moment to review the archives
t
http://archive.midrange.com/midrange-l.
________________________________
his communication, including attachments, is confidential, may be subject to
egal privileges, and is intended for the sole use of the addressee. Any use,
uplication, disclosure or dissemination of this communication, other than by
he addressee, is prohibited. If you have received this communication in error,
lease notify the sender immediately and delete or destroy this communication
nd all copies.
TRVDiscDefault::1201
-
his is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
o post a message email: MIDRANGE-L@xxxxxxxxxxxx
o subscribe, unsubscribe, or change list options,
isit:
http://lists.midrange.com/mailman/listinfo/midrange-l
r email: MIDRANGE-L-request@xxxxxxxxxxxx
efore posting, please take a moment to review the archives
t
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.