|
combine the two suggestions together.
Select * from t2
Union distinct
Select * from t1 where not exists( select '1' from
t2 where t1.id = t2.id
and t1.type = t2.type and t1.value = t2.value)
Michael Schutte
Admin Professional
Bob Evans Farms, Inc.
3776 South High Street, Columbus, OH 43207
"The Secret's the Sauce! Enjoy our new Bob-B-Q
Pulled Pork Knife & Fork
Sandwich!"
java400-l-bounces@xxxxxxxxxxxx wrote on 11/05/2007
10:57:13 AM:
Hidoes
Union distinct works if the value is same, but
not work if the values are different11/05/2007
For example
T1 has data as below
id Type value
schd test abc
schd test1 abc1
T2 has data
id Type value user
schd test xyz myid
in this case i get result as
id Type value
schd test xyz
schd test abc
schd test1 abc1
Ashish
--- Michael_Schutte@xxxxxxxxxxxx wrote:
I'm sorry I may have mislead you there. You
probably want to go more this
route. This obviously haven't been tested.
Select * from t2
Union distinct
Select * from t1
Michael Schutte
Admin Professional
Bob Evans Farms, Inc.
"The Secret's the Sauce! Enjoy our new Bob-B-Q
Pulled Pork Knife & Fork
Sandwich!"
java400-l-bounces@xxxxxxxxxxxx wrote on
from10:37:05 AM:
Select * from t1 where not exists(select '1'
11/05/2007t2 where t1.id = t2.id
and t1.type = t2.type and t1.value = t2.value)Pulled Pork Knife & Fork
Michael Schutte
Admin Professional
Bob Evans Farms, Inc.
"The Secret's the Sauce! Enjoy our new Bob-B-Q
Sandwich!"
java400-l-bounces@xxxxxxxxxxxx wrote on
T2)10:34:02 AM:
there is
Hi
I need some suggestion with sql query
I have 2 table
T1 which has columns
id, type, value
And
T2 has columns
id, type, value, user
T1 has data as below
id Type value
schd test abc
schd test1 abc1
T2 has data
id Type value user
schd test xyz myid
I want to write a SQL to get data from T1 if
different fromno record in T2, The value in T2 may be
T1.
So my result after the query will be
(i dont need user id)
id Type value
schd test xyz (this comes from
T1)schd test1 abc1 (this comes from
__________________________________________________
Any suggestions
Ashish
A$HI$H
spamDo You Yahoo!?
Tired of spam? Yahoo! Mail has the best
theprotection around
http://mail.yahoo.com
--
This is the Java Programming on and around
JAVA400-L@xxxxxxxxxxxxiSeries / AS400
(JAVA400-L) mailing list
To post a message email:
http://lists.midrange.com/mailman/listinfo/java400-loptions,To subscribe, unsubscribe, or change list
visit:
reviewor email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to
JAVA400-L@xxxxxxxxxxxxthe archives
iSeries / AS400at http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the
(JAVA400-L) mailing list
To post a message email:
options,To subscribe, unsubscribe, or change list
http://lists.midrange.com/mailman/listinfo/java400-lvisit:
theor email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review
options,archives
at http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the
iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list
http://lists.midrange.com/mailman/listinfo/java400-lvisit:
theor email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review
protection aroundarchives
at http://archive.midrange.com/java400-l.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam
http://mail.yahoo.comiSeries / AS400
--
This is the Java Programming on and around the
(JAVA400-L) mailing listhttp://lists.midrange.com/mailman/listinfo/java400-l
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
or email: JAVA400-L-request@xxxxxxxxxxxxarchives
Before posting, please take a moment to review the
at http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the
iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the
archives
at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
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.