View previous topic :: View next topic
|
Author |
Message |
winchaat
New User
Joined: 23 Mar 2005 Posts: 14
|
|
|
|
I have a requirement to select the rows from table which is not exist,
consider minimum value for eno is 01 & max 10, whithin this i need to select missing eno's.
anyone help pls!!!
ex-
eno dept
01 ABC
02 DEF
04 DEF
06 HJE
07 KLM
09 KLM
10 MSN
O/P Should be like this
eno
03
05
08
BY
RAG |
|
Back to top |
|
|
gowtham_1982 Warnings : 1 Active User
Joined: 02 Dec 2005 Posts: 109
|
|
|
|
winchaat wrote: |
I have a requirement to select the rows from table which is not exist,
consider minimum value for eno is 01 & max 10, whithin this i need to select missing eno's.
anyone help pls!!!
ex-
eno dept
01 ABC
02 DEF
04 DEF
06 HJE
07 KLM
09 KLM
10 MSN
O/P Should be like this
eno
03
05
08
BY
RAG |
hai rag,
we need to go for some logic as we are not sure the increment size of the field which is varying.
but for this i don't think we have any specific feature in SQL for accomplishing this.
please do let me know if you get to know...
kind regards,
gowtham |
|
Back to top |
|
|
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 121 Location: Tadepalligudem
|
|
|
|
hi,
if ur eno follows the sequence...then use cursors...and a variable counter...compare the variable counter with each record fetched by the cursor...and write the missing records to a file..increment the variable counter for every read by the cursor..if ur table is not having duplicates..
Rajesh/Seshu |
|
Back to top |
|
|
|