database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
ㆍMS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MS-SQL Q&A 1064 게시물 읽기
No. 1064
[질문]mssql에서 intersect 사용
작성자
김종원(ultralra)
작성일
2003-11-27 16:09
조회수
4,692

mssql 에서 intersect 가 지원이 안되서 아래와 같이 구현 하였습니다.

여기서 #intersect 에 결과가 저장 되는데....

 

 


use tempdb
go

if exists(select * from sysobjects where xtype = 'u' and name like '#intersect%')
drop table #intersect

go

use ultralra

select doc.doc_id, doc.title, doc.pos into #intersect from Bagword, doc, term where doc.doc_id = Bagword.doc_id and Bagword.term_id = term.term_id and term.term like '%전자정보%'
go

delete from #intersect where doc_id not in (select doc.doc_id from Bagword, doc, term where doc.doc_id = Bagword.doc_id and Bagword.term_id = term.term_id and term.term like '%전북대학교%')
go

(select doc.doc_id, doc.title, doc.pos from Bagword, doc, term where doc.doc_id = Bagword.doc_id and Bagword.term_id = term.term_id and term.term like '%전자정보%')

(select doc.doc_id, doc.title, doc.pos from Bagword, doc, term where doc.doc_id = Bagword.doc_id and Bagword.term_id = term.term_id and term.term like '%전북대학교%')

select * from #intersect


 

 

이것을 asp.net 에서 사용하는데. 계속 에러가 뜨네요....

아시는분  답변좀 제발 plz

 

에러는

[SqlException: 개체 이름 '##intersect'이(가) 잘못되었습니다.]
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +179
   ASP.output_aspx.DataLoading() in C:\Inetpub\wwwroot\ultralra\output.aspx:85
   ASP.output_aspx.Page_Load(Object Src, EventArgs E) in C:\Inetpub\wwwroot\ultralra\output.aspx:26
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +731

이고요 에라 코드는

   sqlS = "delete from ##intersect where doc_id not in (select doc.doc_id from Bagword, doc, term where doc.doc_id = Bagword.doc_id and Bagword.term_id = term.term_id and term.term like '%" + s + "%')";
    myCommandCount = new SqlCommand(sqlS, myConnection);
    myConnection.Open();
    myCommandCount.ExecuteNonQuery();
    myConnection.Close();

입니다.

 

 

[Top]
No.
제목
작성자
작성일
조회
1067bak 파일 복원
최상현
2003-11-28
5805
1066문제를 풀고 있는데요.......
초보학생
2003-11-28
4403
1065덤프에 관한 문제.... 뷰인거 같은데요....
뺘라밤
2003-11-28
4556
1064[질문]mssql에서 intersect 사용
김종원
2003-11-27
4692
1063MSSQL에서 지원되는 패스워드 함수가 있는지요?
김동우
2003-11-27
4276
1062간단한 쿼리질문 입니다. [2]
jinny
2003-11-27
4080
1061[질문] nvarchar 최대가 4000인데 더 이상 쓰고 싶으면
박진석
2003-11-27
5433
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.016초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다