March 29, 2012 at 9:27 pm
Comments posted to this topic are about the item NOT BETWEEN
March 29, 2012 at 9:28 pm
March 29, 2012 at 9:50 pm
Good question Steve.
M&M
March 29, 2012 at 10:23 pm
We like these questions that require fewer brain cells to cap the week.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 30, 2012 at 12:03 am
Hi..
I got 1,6 as output..
I run this query on SQL server and got the same output.
Please let me know how we can get 2 as output.
March 30, 2012 at 12:54 am
The question asked how many rows are returned. It didn't ask which rows were returned.
Dave
March 30, 2012 at 1:13 am
just wake up from snap. I miss NOT BETWEEN --> BETWEEN so my answer: 4 :hehe:
March 30, 2012 at 1:53 am
Nice QOTD to end the week.
Thanks Steve.
March 30, 2012 at 1:53 am
Thanks Steve for an easy question to finish the week!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
March 30, 2012 at 2:21 am
This one was so easy that I was looking for the "trick." I kept look and looking but never found one so I finally submitted my answer. I was relieved to see that I got it right. The amount of tension waiting to see the "You got it right" message was overwhelming.
March 30, 2012 at 2:39 am
Thanks for the easy QOTD!
March 30, 2012 at 2:56 am
Easy point today - thanks Steve
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
March 30, 2012 at 3:20 am
cengland0 (3/30/2012)
This one was so easy that I was looking for the "trick." I kept look and looking but never found one so I finally submitted my answer. I was relieved to see that I got it right. The amount of tension waiting to see the "You got it right" message was overwhelming.
+1
I do not like qotd too easy or without tricks.
:w00t:
March 30, 2012 at 5:26 am
Carlo Romagnano (3/30/2012)
cengland0 (3/30/2012)
This one was so easy that I was looking for the "trick." I kept look and looking but never found one so I finally submitted my answer. I was relieved to see that I got it right. The amount of tension waiting to see the "You got it right" message was overwhelming.+1
I do not like qotd too easy or without tricks.
:w00t:
I get paranoid when the question SEEMS too easy. Sometimes life really is that easy - strange but true. 🙂
[font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
Connect to me on LinkedIn
March 30, 2012 at 5:57 am
I guessed 2 because BETWEEN is inclusive, and then I tried to run it. I found out that I needed SQL Server 2008 compatibility, don't have that, only 2005, so I changed the VALUES clause to UNIONs, and the DATE to DATEtime, then fuond out I had to be logged in as dbo, don't have that either, so I took the dbo. off of the select, and then it returned two rows, voila`!
CREATE TABLE SalesDates
(id INT, saledate DATEtime
);
go
INSERT INTO SalesDates
SELECT
1, '2012/1/1'
UNION
SELECT
2, '2012/1/2'
UNION
SELECT
3, '2012/1/3'
UNION
SELECT
4, '2012/1/4'
UNION
SELECT
5, '2012/1/5'
UNION
SELECT
6, '2012/1/6';
go
SELECT id
FROM SalesDates s
WHERE s.saledate NOT BETWEEN '2012/1/2' AND '2012/1/5';
go
DROP TABLE SalesDates;
Viewing 15 posts - 1 through 15 (of 29 total)
You must be logged in to reply to this topic. Login to reply