Mike & Buddy,

Thanks for your suggestions. I will try those today.

Your help is much appreciated.

Thank you.

Regards,
 
John Docherty

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Ramsour Mike
Sent: Wednesday, 19 March 2008 1:46 a.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Unique Values

John:

Maybe the following example will help.

SET VAR VCNTALL INTEGER = 0
SET VAR VUNIQUE INTEGER = 0
SELECT COUNT(*),COUNT(DISTINCT MELTCODE) INTO VCNTALL, VUNIQUE FROM REJECT
--
-- RESULTS
--
--  Variable           = Value                                   Type
--  ------------------   ------------------------------          --------
--  VCNTALL            = 53783                                    INTEGER 
--  VUNIQUE            = 66 (unique meltcode values in reject)    INTEGER
--
--
OR YOU COULD TRY THIS APPROACH WITH YOUR DATA.
--
DROP VIEW TEMPVIEW
--
CREATE TEMPORARY VIEW TEMPVIEW (MELTCODE,MELT_CNT) +
AS SELECT MELTCODE,COUNT(MELTCODE) FROM REJECT GROUP BY MELTCODE

In this scenario you might only print records where MELT_CNT (in my example)
is greater than 1.

Mike Ramsour
AK Steel Coshocton Works
Quality Department

Phone/VMS:  740-829-4340
-----Original Message-----
From: John Docherty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 18, 2008 7:17 AM
To: [email protected]
Subject: [RBASE-L] - RE: Unique Values

Buddy  & Gunnar,

Thanks for your replies. Is there a way I can get the answer into a
variable, as I then want to use this to decide how to order some printing
which prints totals for identical values, if there are any, or prints them
as they have been entered into a pricing schedule if there aren't any ?
All I want to know is if there are any identical values or not in the data
to be printed.  I trust that this explains what I am trying to do a bit more
clearly. (Perhaps I need the IF_UNIQUE function ?)

Thank you.

Regards,
 
John Docherty

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Walker,
Buddy
Sent: Tuesday, 18 March 2008 11:39 p.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Unique Values

John
  You could do something like this

SELECT COUNT(*) TxtColumn FROM TableName +
GROUP BY TxtColumn HAVING COUNT(*) > 1

Buddy

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of John
Docherty
Sent: Tuesday, March 18, 2008 6:05 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Unique Values

I was wondering if there is a quick way of determining if all rows in a
selection have a distinct value, the column in question being a text field.
Any suggestions (or the obvious answer which I cannot think of), would be
much appreciated.

Thank you.

Regards,
 
John Docherty

--- RBASE-L
=======================3D=======================
D=
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
=======================3D=======================
D=
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
=======================3D=======================
D=
TO UNSUBSCRIBE: 
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
=======================3D=======================
D=
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, 
place any 
text to search for.
=======================3D=======================
D=


Reply via email to