×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Update table Error : single-row subquery returns more than one row

Update table Error : single-row subquery returns more than one row

Update table Error : single-row subquery returns more than one row

(OP)
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

RE: Update table Error : single-row subquery returns more than one row

(OP)
hi,PHV

its not only use 1 table to update.... it may join more than 4 table...

but my problem is solved .....

any thanks for ur solution


regards,
s1

RE: Update table Error : single-row subquery returns more than one row

but my problem is solved
Could you, please, share your solution for the benefit of the members ?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close