View previous topic :: View next topic
|
Author |
Message |
withnams
New User
Joined: 06 Jul 2005 Posts: 26 Location: Chennai
|
|
|
|
Hi All,
I have 2 tables. In Table1 i have a column that has data in the following manner
colA
----
T1,T2,T3...
T4,T5
T6,T7,T8,T9...
in table 2 i have a unique column that has data in the following manner
colB
------
T1
T2
T3
T4
T5
Now what i need is i have to search in colA of table1 with the value taken from colB. If i dont have a match then i need to give the value of colB.
I need to accomplish this in a query.
Can you people help me out? |
|
Back to top |
|
|
sarath_ibm
New User
Joined: 03 Aug 2005 Posts: 14 Location: hyderabad
|
|
|
|
I Dont Know correctly Try Right Outer join U May get the result |
|
Back to top |
|
|
ragshere
New User
Joined: 20 Dec 2004 Posts: 70
|
|
|
|
Hi,
i am understanding the column in first table will contain values as a concatnation of values.
in this case You can LOCATE or POSSTR function to findout whether it contains value of column in second table.
You have to CASE statement in the query to display colB value if it is not found in first table.
Hope You understand what I am saying.
Thanks
Rags |
|
Back to top |
|
|
withnams
New User
Joined: 06 Jul 2005 Posts: 26 Location: Chennai
|
|
|
|
Thanks. will try and let you know rags. |
|
Back to top |
|
|
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
|
|
use the right outer join.This query will include rows from the table that have been specified after right outer join and with no matching values in the table.
select part,supplier,product.products.prod# from parts
right outer join products
on parts.prod#=products.prod#. |
|
Back to top |
|
|
|