题目内容

Question10: How can I list non-contignous data?
In database pubs, I create a table test using statement as below, and I
insert several row as below
create table test
(id int primary key )
go
insert into test values (1 )
insert into test values (2 )
insert into test values (3 )
insert into test values (4 )
insert into test values (5 )
insert into test values (6 )
insert into test values (8 )
insert into test values (9 )
insert into test values (11)
insert into test values (12)
insert into test values (13)
insert into test values (14)
insert into test values (18)
insert into test values (19)
go
Now I want to list the result of the non-contignous row as below,how can I
do it?
Missing after Missing before
------------- --------------
6 8
9 11
...

查看答案
更多问题

Question 1:Can you use a batch SQL or store procedure to calculating
the Number of Days in a Month

Question2:Can you use a SQL statement to calculating it!
How can I print "10 to 20" for books that sell for between $10 and $20,
"unknown" for books whose price is null, and "other" for all other prices?

巴拿赫病故于1945 年8 月31 日。他的出生年份恰好是他在世时某年年
龄的平方,问:他是哪年出生的?

Question 7: Can you tell me what the difference of two SQL statements at
performance of execution?
Statement 1:
if NOT EXISTS (select * from publishers where state = 'NY')
begin
SELECT 'Sales force needs to penetrate New York market'end
else
begin
SELECT 'We have publishers in New York'
end
Statement 2:
if EXISTS (select * from publishers where state = 'NY')
begin
SELECT 'We have publishers in New York'
end
else
begin
SELECT 'Sales force needs to penetrate New York market'
end

答案查题题库