-
Notifications
You must be signed in to change notification settings - Fork 0
/
po.sql
81 lines (51 loc) · 1.87 KB
/
po.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
USE inteva_po
go
create table po_transaction(
po_number varchar(100) not null default '-' ,
po_date datetime not null default '1900-01-01 ' ,
sequence_serial_no varchar(100) not null default '-',
asset_description varchar(100) not null default '-' ,
io_number varchar(100) not null default '-' ,
currency_name varchar(100) not null default '-' ,
unit_price decimal(29,2) not null default '0.00',
requester_id varchar(100) not null default '-' ,
cc_id int not null default '0',
quantity int not null default '0'
)
go
update po_transaction set sequence_serial_no= '000'+sequence_serial_no
select * from po_transaction where
po_number='A000004798'
go
--update B set B.currency_name = A.currency_name from
--(
--select t1.* from po_transaction t1 , po_transaction t2 where
--t1.po_number=t2.po_number and t1.sequence_serial_no = t2.sequence_serial_no
--and t1.asset_description!=t2.asset_description
--and t1.currency_name ='-'
--)B,
--(
--select t1.* from po_transaction t1 , po_transaction t2 where
--t1.po_number=t2.po_number and t1.sequence_serial_no = t2.sequence_serial_no
--and t1.asset_description!=t2.asset_description
--and t1.currency_name !='-'
--)
--A
--where
--A.po_number=B.po_number and A.sequence_serial_no = B.sequence_serial_no
--and A.asset_description!=B.asset_description
select t1.* from po_transaction t1 , po_transaction t2 where
t1.po_number=t2.po_number and t1.sequence_serial_no = t2.sequence_serial_no
--and t1.asset_description!=t2.asset_description
and t1.asset_description !='-'
go
select distinct t1.* from po_transaction t1 , po_transaction t2 where
t1.po_number=t2.po_number and t1.asset_description ='-'
--sequence_serial_no
--000830
--currency_name
--asset_description
---
--currency_name
--USD
--po_number='A000004798'