Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

select 한 값을 바로 update구문에 집어넣어서

80 views
Skip to first unread message

Dobal

unread,
Nov 22, 2001, 11:42:24 PM11/22/01
to
샬롬!

Sub Query라는 기능인데요.
MSSQL에서는 가능합니다.


"황혜미" <sylp...@kdspos.com> wrote in message
news:ORT$xu0cBHA.1960@tkmsftngp03...
> select 한 값을 바로 update구문에 집어넣어서
> select와 update를 한쿼리에 다 쓸 수 있나요??
> 예를 들면 이런식으로
> update milehistory set userid = tbmcf02.mcs0202
> where (select mcs0202 from mcf02 where mcs0201='0000000000000003') tbmcf02
>
> 그런데..이게 안되네요.. 이런 방법 아세여??
>
>


권동욱

unread,
Nov 23, 2001, 12:28:51 AM11/23/01
to
sql Query구문을 어떻게 쓰셨는지 모르겠지만. 황혜미님의 subQuery문법이 틀린
듯 합니다
subQuery와 연동한 update구문을 다시 한번 점검해보시겠어요?

보통 아래와 같습니다만.. 그럼 참고되세요.. (thank U 라는 말 한마디 좀
들어봤으면... ㅡㅡ;;)

UPDATE table_name SET column_name = (SELECT expression FROM . . .WHERE . .
.)

그럼 억수로 수거..ㅎㅎ

박성우

unread,
Nov 23, 2001, 2:53:52 AM11/23/01
to
아래 구문이 틀렸네요.
where절에 비교기준이 되는 필드명을 넣어야죠.
예를 들면,
where 필드명 in (select mcs0202 from mcf02 where mcs0201='0000000000000003')

이현국

unread,
Nov 23, 2001, 9:06:28 PM11/23/01
to
database에 따라 서브쿼리가 허용안되는게 있는데

oracle이나 mssql이면 가능합니다.

아래 이야기 하신 문법만 조금 수정하면 문제 없을듯 하네요.


0 new messages