0

I can't seem to figure out where is the syntax mistake. Even though the query is very simple.

Thanks in advance!

UPDATE t_stock
set f_atcid = (select a.id from t_atc a where a.f_code = ' ' where rownum < 2)
where id in (select f_stockid from t_barcode where f_barcode = ' ');
2
  • and whats the error message? Commented Mar 18, 2016 at 10:49
  • 2
    Though is silly mistake I found this to be a common error(having two where clauses). I would keep this question on the site. Commented Mar 18, 2016 at 11:11

1 Answer 1

2

The problem is two where clauses. Change the second to and:

UPDATE t_stock
    set f_atcid = (select a.id
                   from t_atc a
                   where a.f_code = ' ' and
----------------------------------------^
                         rownum < 2
                  )
where id in (select f_stockid from t_barcode where f_barcode = ' ' ); 
Sign up to request clarification or add additional context in comments.

1 Comment

What a silly mistake. Everything seems to working fine now. Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.