Home » SQL & PL/SQL » SQL & PL/SQL » exclude a group of records
exclude a group of records [message #243322] Wed, 06 June 2007 22:29 Go to next message
feizz
Messages: 16
Registered: December 2006
Location: Singapore
Junior Member

Hi,
please help me on getting this query.

TABLE
COL1 COL2 COL3
1 X A
2 X Z
3 X Z
4 X Z
5 X Z
6 Y Z
7 Y Z
8 Y Z
9 Y Z
10 Y Z

i wanted a query that only select the group of records without COL3 having value A.

Regards, feizz
Re: exclude a group of records [message #243323 is a reply to message #243322] Wed, 06 June 2007 22:33 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>i wanted a query that only select the group of records without COL3 having value A.
I want a pony for my birthday.
So what are YOU going to do to solve this homework problem?

Please explain why it takes an EXPERT to answer a basic SQL question.

[Updated on: Wed, 06 June 2007 22:34] by Moderator

Report message to a moderator

Re: exclude a group of records [message #243329 is a reply to message #243323] Wed, 06 June 2007 23:06 Go to previous messageGo to next message
feizz
Messages: 16
Registered: December 2006
Location: Singapore
Junior Member

not to sure about that EXPERT answer, but thanks anyway.
Re: exclude a group of records [message #243331 is a reply to message #243322] Wed, 06 June 2007 23:09 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
Did you read and follow ANY of the steps listed in the #1 STICKY post at the top of this forum?
If so, please list them.
If not, why not?
http://www.orafaq.com/forum/m/111616/74940/#msg_111616
Re: exclude a group of records [message #243353 is a reply to message #243331] Thu, 07 June 2007 01:12 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
It would be nice if someone would follow the guidelines. It'll help a lot if you want a quick answer. So, you want to SELECT data FROM your table WHERE col3 is different (!=) from 'A'? How hard can it be...

What have you tried and what went wrong?

MHE
Re: exclude a group of records [message #243356 is a reply to message #243353] Thu, 07 June 2007 01:18 Go to previous messageGo to next message
feizz
Messages: 16
Registered: December 2006
Location: Singapore
Junior Member

Hi MHE,
i've tried some queries, it is just didn't get the correct answer that i required. Below is my query.

/* Formatted on 2007/06/07 14:16 (Formatter Plus v4.8.0) */
(SELECT   a.poprno, MIN (a.poopno) poopno, a.poplgr
     FROM pfods.mpdope a
    WHERE pofaci = 'MF1'
      AND postrt = 'STD'
      AND pocono = 1
      AND poprno NOT IN (
             SELECT DISTINCT poprno
                        FROM pfods.mpdope a
                       WHERE pofaci = 'MF1'
                         AND postrt = 'STD'
                         AND pocono = 1
                         AND poopds = 'P250 SMD-AUTOMAT')
 GROUP BY a.poprno, a.poplgr)


-- Basically i want to exclude a group of records that has poopds = 'P250 SMD-AUTOMAT'.
Thanks for you help

[Updated on: Thu, 07 June 2007 01:28] by Moderator

Report message to a moderator

Re: exclude a group of records [message #243361 is a reply to message #243356] Thu, 07 June 2007 01:29 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't you know "!=" or "<>" comparison operator?

Btw, read and apply How to format your posts.

Regards
Michel

OK, now, with SQL formatted I see my post is useless.

Regards
Michel


[Updated on: Thu, 07 June 2007 01:30]

Report message to a moderator

Re: exclude a group of records [message #243362 is a reply to message #243356] Thu, 07 June 2007 01:35 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Why select twice from the same table? Why not simply add this to your outer query (notice the code tags ;):
AND    poopds != 'P250 SMD-AUTOMAT'
That way you can loose the entire "not in" part. If it is not sufficient, post:
1. a create table statement
2. insert statements for sample data
3. the desired output based on that sample data


MHE

Re: exclude a group of records [message #243376 is a reply to message #243362] Thu, 07 June 2007 02:32 Go to previous messageGo to next message
feizz
Messages: 16
Registered: December 2006
Location: Singapore
Junior Member

hi Maaher,
i've tried the recommended solution, however, the group of records are still exist.
Re: exclude a group of records [message #243378 is a reply to message #243362] Thu, 07 June 2007 02:44 Go to previous messageGo to next message
feizz
Messages: 16
Registered: December 2006
Location: Singapore
Junior Member

Hi,
i suppose i should be clearer, attached is the data.
I only want to select group records which are not having POOPDS = 'P250 SMD-AUTOMAT'.
This means that should exclude all records where cols POPRNO = '086410'.


Thks for your help.
  • Attachment: XLS1.xls
    (Size: 176.00KB, Downloaded 457 times)
Re: exclude a group of records [message #243412 is a reply to message #243378] Thu, 07 June 2007 04:16 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
An Excel file is not really ideal. A lot of people won't (can't) download just any document from the Internet.

Here's what I expected:

1. CREATE TABLE statements (simplified, only relevant columns):
CREATE TABLE yourtable( POCONO NUMBER
                      , POFACI VARCHAR2(3)
                      , POPRNO NUMBER
                      , POSTRT VARCHAR2(3)
                      , POOPNO NUMBER
                      , POPLGR NUMBER
                      , POOPDS VARCHAR2(30)
                      )
/


2. INSERT statements with sample data:
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 10
           , 110200
           , 'P--- CHANGE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 20
           , 110200
           , 'P253 ASSEMBLY'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 30
           , 110200
           , 'P--- CIRCUIT DIAGRAM'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 40
           , 110200
           , 'P306 LASER TRIMMING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 50
           , 110200
           , 'P270 FUNCTION TEST/CHECK'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 55
           , 110200
           , 'P--- INSTRUCTION'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 60
           , 110200
           , 'INSERT INTO HOUSING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 70
           , 110200
           , 'P329 FILLING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 100
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 110
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 120
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 130
           , 110200
           , 'FINAL TEST'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 135
           , 110200
           , 'P--- INSTRUCTION'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 140
           , 110200
           , 'P253 ASSEMBLY'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 150
           , 110200
           , 'P319 PACKING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000073
           , 'STD'
           , 160
           , 110200
           , 'P--- DISPATCH'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 10
           , 110200
           , 'P--- CHANGE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 20
           , 110200
           , 'P253 ASSEMBLY'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 30
           , 110200
           , 'P--- CIRCUIT DIAGRAM'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 40
           , 110200
           , 'P306 LASER TRIMMING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 45
           , 110200
           , 'P--- INSTRUCTION'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 50
           , 110200
           , 'P270 FUNCTION TEST/CHECK'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 60
           , 110200
           , 'INSERT INTO HOUSING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 70
           , 110200
           , 'P329 FILLING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 90
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 100
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 130
           , 110200
           , 'FINAL TEST'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 135
           , 110200
           , 'P--- INSTRUCTION'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 140
           , 110200
           , 'P253 ASSEMBLY'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 150
           , 110200
           , 'P319 PACKING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000074
           , 'STD'
           , 160
           , 110200
           , 'P--- DISPATCH'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 10
           , 110200
           , 'P--- CHANGE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 15
           , 110200
           , 'CABLE ASSEMBLY'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 20
           , 110200
           , 'P301 MATERIALS PREPARATION'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 30
           , 110200
           , 'P253 ASSEMBLY'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 40
           , 110200
           , 'P--- CIRCUIT DIAGRAM'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 45
           , 110200
           , 'COIL PRE-FILLING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 50
           , 110200
           , 'LASER TRIMMING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 50
           , 110200
           , 'P306 LASER TRIMMING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 52
           , 110200
           , 'P344 SILICONE COATING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 55
           , 110200
           , 'INSERT INTO HOUSING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 58
           , 110200
           , 'FUNCTION TEST-SENSING RANGE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 58
           , 110200
           , 'P270 FUNCTION TEST/CHECK'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 60
           , 110200
           , 'P329 FILLING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 80
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 90
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 110
           , 110200
           , 'FINAL TEST'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 110
           , 110200
           , 'FINAL TEST'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 120
           , 110200
           , 'PACKING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 120
           , 110200
           , 'PACKING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 120
           , 110200
           , 'P319 PACKING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000614
           , 'STD'
           , 130
           , 110200
           , 'P--- DISPATCH'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 20
           , 110200
           , 'P--- CHANGE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 40
           , 110200
           , 'P301 MATERIALS PREPARATION'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 60
           , 110200
           , 'P253 ASSEMBLY'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 80
           , 110200
           , 'P--- CIRCUIT DIAGRAM'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 100
           , 110200
           , 'P--- INSTRUCTION'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 120
           , 110200
           , 'SOLDER BATH'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 130
           , 110200
           , 'FUNCTION TEST/CHECK'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 130
           , 110200
           , 'FUNCTION TEST/CHECK'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 130
           , 110200
           , 'P270 FUNCTION TEST/CHECK'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 140
           , 110200
           , 'ADJUSTMENT/TRIMMING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 140
           , 110200
           , 'ADJUSTMENT/TRIMMING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 140
           , 110200
           , 'ADJUSTMENT/TRIMMING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 160
           , 110200
           , 'FILLING,WELDING,CLEANING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 200
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 220
           , 110200
           , 'PRINT SINGAPORE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 220
           , 110200
           , 'P314 PRINTING TAMPON'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 225
           , 110200
           , 'P--- PRINT SINGAPORE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 240
           , 110200
           , 'FINAL TEST'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 240
           , 110200
           , 'FINAL TEST'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 240
           , 110200
           , 'FINAL TEST'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 250
           , 110200
           , 'PACKING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 250
           , 110200
           , 'PACKING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 250
           , 110200
           , 'P319 PACKING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 000700
           , 'STD'
           , 260
           , 110200
           , 'P--- DISPATCH'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 10
           , 190222
           , 'P--- CHANGE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 20
           , 190233
           , 'IC - BURNING'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 70
           , 190222
           , 'BASEPLATE FOR SMD A+B SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 70
           , 190222
           , 'BASEPLATE FOR SMD'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 80
           , 190222
           , 'COORDINATION LIST A-SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 80
           , 190222
           , 'P--- COORDINATION LIST B-SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 90
           , 190222
           , 'COORDINATION LIST B-SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 90
           , 190222
           , 'P--- COORDINATION LIST A-SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 95
           , 190222
           , 'SOLDER SCREEN B SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 95
           , 190222
           , 'SOLDER SCREEN B SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 95
           , 190222
           , 'P--- SOLDER STENCIL B SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 100
           , 190222
           , 'SMD-AUTOMAT'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 100
           , 190222
           , 'SMD-AUTOMAT'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 100
           , 190222
           , 'P250 SMD-AUTOMAT'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 110
           , 190222
           , 'CIRCUIT DIAGRAM'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 110
           , 190222
           , 'P--- CIRCUIT DIAGRAM'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 120
           , 190222
           , 'P--- SOLDERING - REFLOW'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 125
           , 190222
           , 'GLUE SCREEN A-SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 125
           , 190222
           , 'P--- GLUE STENCIL A-SIDE'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 130
           , 190222
           , 'SMD-AUTOMAT'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 130
           , 190222
           , 'SMD-AUTOMAT'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 130
           , 190222
           , 'P250 SMD-AUTOMAT'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 150
           , 190222
           , 'P--- SOLDERING - REFLOW'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 160
           , 190222
           , 'P252 VISUAL CHECK'
            );
INSERT INTO yourtable
            (pocono
           , pofaci
           , poprno
           , postrt
           , poopno
           , poplgr
           , poopds
            )
VALUES      (1
           , 'MF1'
           , 086410
           , 'STD'
           , 180
           , 190222
           , 'P--- DISPATCH'
            );

commit;


3. Expected output, based on that sample data: not provided.

If you provide the expected output we can help you further. Don't forget to use [code] and [/code] around code snippets.

MHE

[Updated on: Thu, 07 June 2007 04:17]

Report message to a moderator

Previous Topic: Change of Order BY clause in Cursor
Next Topic: Help
Goto Forum:
  


Current Time: Fri Dec 09 17:15:13 CST 2016

Total time taken to generate the page: 0.39361 seconds