Viewing 15 posts - 48,016 through 48,030 (of 59,099 total)
samsql (10/1/2008)
how many rows are there with 3 not null values and
how many rows are there with 4 not null values
from column image1 to...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 1, 2008 at 6:18 am
I've answered several of your questions and provided a code solution... the least you could do is answer just one of mine... what is the purpose of this code?
--Jeff Moden
Change is inevitable... Change for the better is not.
October 1, 2008 at 6:04 am
bhuvnesh.dogra (9/30/2008)
we need to show record randomly
Heh... I already know that... but, why is it a requirement? What is it that you are trying to do? ie. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 11:30 pm
A CTE is nothing more than a "derived table" or an "inline view"... both of which are just sub-queries. If you did it the "old way" without a CTE,...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 11:16 pm
samsql (9/30/2008)
jeff thkz for the reply but i dnt want this.....i want the count
Yeah... You'e right. I misread your requirements. Sorry.
If you could provide a little test data...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 10:58 pm
This will work... without TOP or a correlated subquery to use it...
;WITH
cteRandom AS
(SELECT ROW_NUMBER() OVER (PARTITION BY Gid ORDER BY NEWID()) AS RandRow,
...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 10:54 pm
bhuvnesh.dogra (9/30/2008)
Is it possible to use TOP in this query ....i want to use TOP
Why?
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 10:38 pm
Here's the corrected test code and a solution... Now, I'm curious... why don't you care which RecID you return, please?
create table mytest
(
Recid int ,
Gid varchar(2) )
GO
------------------------------------------------
insert into mytest(RecID,Gid) select...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 10:29 pm
The test code produces errors.
The way to do this is to use MIN and GROUP BY.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 10:26 pm
It would really be helpful if, in the future, you would pose such questions with a properly formed create table statement and some ready to use data. Please see...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 10:22 pm
Vincent Central (9/30/2008)
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 9:27 pm
mixalissen (9/30/2008)
UPDATE t
SET var1 = var2
FROM someTable,(
...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 9:24 pm
Heh... I find it very difficult to believe an article on performance where the author says "At first, we prepare a test table with 1 million records:" and then builds...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 9:21 pm
John, the article that Richard was referring to (thank you for the kudo, Richard) is located at the following URL...
[font="Arial Black"]The "Numbers" or "Tally" Table: What it is and how...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 9:07 pm
Well done, Richard! 🙂
Just a suggestion... you may be able to get a wee bit more speed out of it if you eliminate as many of the math functions as...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 9:04 pm
Viewing 15 posts - 48,016 through 48,030 (of 59,099 total)