-1
내가 여기서 뭐하는거야? 이 쿼리 결과는 0 행입니다. 상태 테이블은 int 유형입니다SQL 쿼리가 잘못되었습니다
CREATE OR replace view ACTIVE_GROUPS AS
SELECT id, name, status
FROM test1.group
WHERE status != 2 group by id
내가 여기서 뭐하는거야? 이 쿼리 결과는 0 행입니다. 상태 테이블은 int 유형입니다SQL 쿼리가 잘못되었습니다
CREATE OR replace view ACTIVE_GROUPS AS
SELECT id, name, status
FROM test1.group
WHERE status != 2 group by id
아마 당신은 .1을 test1의 끝에 넣지 않을 것입니까? group by id
도 필요하지 않을 수도 있습니다.
SELECT id, name, status
FROM test1
WHERE status != 2 group by id
IF if exists(select * from INFORMATION_SCHEMA.VIEWS where TABLE_NAME='ACTIVE_GROUPS')
BEGIN
ALTER view ACTIVE_GROUPS AS
SELECT id, name, status
FROM test1.group
WHERE status != 2 group by
END
ELSE
CREATE view ACTIVE_GROUPS AS
SELECT id, name, status
FROM test1.group
WHERE status != 2 group by id
BEGIN
END
글쎄, 당신은 모든 ID에 대한 임의의 (또는 불확정) 이름과 상태를 따기 있습니다. – Strawberry