Hi,
im newbie of sql user
Im try to write a script to update description base on condition that u insert
, the purpose of write this query is for "Remove Title" by using substring ,
Eg: "TT MOVIE dynasty package" , change description to display "dynasty package"
but its pop--up common error "single-row subquery returns more than one row".
here is my query
update table1
--Is set for remove the front title description
set descr = (select SUBSTR(t1.descr,10)
from table1 t1,
table2 t2,
table3 t3,
table4 t4,
table5 t5
where
t1.id=table1.id and
t1.t2_OBJ_ID0 = t2.id and
t3.id = t2.t3_OBJ_ID0 and
t3.id = t4.t3_OBJ_ID0 and
t5.id = t4.t5_OBJ_ID0 and
----retrieve which title description
upper(t1.descr) like 'TT MOVIE%'
---- to insert the condition that you want to remove
t5.descr in(
'TT MOVIE dynasty package',
'TT MOVIE western package'
)
)
where exists (select SUBSTR(t1.descr,10)
from table1 t1,
table2 t2,
table3 t3,
table4 t4,
table5 t5
where
t1.id=table1.id and
t1.t2_OBJ_ID0 = t2.id and
t3.id = t2.t3_OBJ_ID0 and
t3.id = t4.t3_OBJ_ID0 and
t5.id = t4.t5_OBJ_ID0 and
--retrieve which title description
upper(t1.descr) like 'TT MOVIE%'
-- to insert the condition that you want to remove
t5.descr in(
'TT MOVIE dynasty package',
'TT MOVIE western package'
)
);
thanks
regards,
s1
im newbie of sql user
Im try to write a script to update description base on condition that u insert
, the purpose of write this query is for "Remove Title" by using substring ,
Eg: "TT MOVIE dynasty package" , change description to display "dynasty package"
but its pop--up common error "single-row subquery returns more than one row".
here is my query
update table1
--Is set for remove the front title description
set descr = (select SUBSTR(t1.descr,10)
from table1 t1,
table2 t2,
table3 t3,
table4 t4,
table5 t5
where
t1.id=table1.id and
t1.t2_OBJ_ID0 = t2.id and
t3.id = t2.t3_OBJ_ID0 and
t3.id = t4.t3_OBJ_ID0 and
t5.id = t4.t5_OBJ_ID0 and
----retrieve which title description
upper(t1.descr) like 'TT MOVIE%'
---- to insert the condition that you want to remove
t5.descr in(
'TT MOVIE dynasty package',
'TT MOVIE western package'
)
)
where exists (select SUBSTR(t1.descr,10)
from table1 t1,
table2 t2,
table3 t3,
table4 t4,
table5 t5
where
t1.id=table1.id and
t1.t2_OBJ_ID0 = t2.id and
t3.id = t2.t3_OBJ_ID0 and
t3.id = t4.t3_OBJ_ID0 and
t5.id = t4.t5_OBJ_ID0 and
--retrieve which title description
upper(t1.descr) like 'TT MOVIE%'
-- to insert the condition that you want to remove
t5.descr in(
'TT MOVIE dynasty package',
'TT MOVIE western package'
)
);
thanks
regards,
s1