Home » SQL & PL/SQL » SQL & PL/SQL » comparing values in table (11i)
comparing values in table [message #337843] Fri, 01 August 2008 05:56 Go to next message
annu-agi
Messages: 203
Registered: July 2005
Location: Karachi
Senior Member

hi experts

I have 2 tables

1 orders
2 purchase_orders

Order has feild order_number and data like

974
978
1068
961
971
964
969

and purchase order has one feild comments and date like

OIA#974 Manual PO#2090 date11-11-2007
OIA#974 Manual PO#2090 date11-11-2007
OIA#974 Manual PO#2090 date11-11-2007
OIA-978 MANUAL PO No. ATL-2106
OIA-978 MANUAL PO No. ATL-2106
OIA-1068 MOBILINK GSM, PO No. ARWEN0210, SO# 9872343
OIA-1068 MOBILINK GSM, PO No. ARWEN0210, SO# 9872343
OIA-961-KSE, PO# ARWEN0135 SO# 9526253
OIA-961-KSE, PO# ARWEN0135 SO# 9526253
OIA-961-KSE, PO# ARWEN0135 SO# 9526253
OIA-961-KSE, PO# ARWEN0135 SO# 9526253
OIA-964-GSK, PO ARWEN0135 SO# 9529364
OIA-964-GSK, PO ARWEN0135 SO# 9529364
P.O No. Arwen0147 (OIA- 971) SO# 9576813
OIA-964-GSK, PO ARWEN0135 SO# 9529364
OIA-964-GSK, PO ARWEN0135 SO# 9529364
OIA-1068 MOBILINK GSM, PO No. ARWEN0210, SO# 9872343
OIA-1068 MOBILINK GSM, PO No. ARWEN0210, SO# 9872343
OIA-961-KSE, PO# ARWEN0135 SO# 9526253
OIA-965 SWISSTEX, MANUAL PO No.ARWEN0141
OIA-969- O&G Exp. PO No. ARWEN0148 SO# 9583694


and there is no pk , fk relation between these tables and i want to join them

for that i use

AND b.cOMMENTS LIKE '%'||a.ORDER_NUMBER||'%'


for join condition.


that is almost fine and i m getting results.
but now i want that to make one view over these tables and make one more column which has extracted value of order number from comments feild of purchase_order table . it is just like my comparing statement but how can i do that .. i dont know ..
help me out of this problem .. kindly its urgent


regards and thanks in advance

annu



Re: comparing values in table [message #337850 is a reply to message #337843] Fri, 01 August 2008 06:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
100+ posts, you have no excuse to not follow the OraFAQ Forum Guide.

Regards
Michel
Re: comparing values in table [message #337885 is a reply to message #337843] Fri, 01 August 2008 08:19 Go to previous message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
annu-agi wrote on Fri, 01 August 2008 12:56
but now i want that to make one view over these tables and make one more column which has extracted value of order number from comments feild of purchase_order table . it is just like my comparing statement but how can i do that .. i dont know ..

Why do you not simply use a.ORDER_NUMBER?
Seems to me like logical problem - to get a part of string equivalent to the some value which is not known.
If you would post here sample data, how would you extract this value?
Previous Topic: Need a better query
Next Topic: Query logic
Goto Forum:
  


Current Time: Wed Dec 07 22:32:26 CST 2016

Total time taken to generate the page: 0.20535 seconds