Viewing 15 posts - 826 through 840 (of 1,228 total)
Something like this?
WITH RandimisedResults AS (
select CaseNumber, AgentName,
rn = ROW_NUMBER() OVER (PARTITION BY AgentName ORDER BY NEWID())
from dbo.CaseSummary
where CaseDate >= @DateFrom
and ...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 20, 2011 at 5:19 am
SELECT *
FROM customers c
INNER JOIN tickets t1 ON t1.CustId = c.CustId AND t1.[subject] = 'info'
INNER JOIN tickets t2 ON t2.CustId = c.CustId AND t2.[subject] = 'problem'
WHERE t2.ticketDate >...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 20, 2011 at 4:35 am
SQLRO (5/20/2011)
Yes. You are right.
Paul's article shows an efficient and rigorously tested method for doing this.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 20, 2011 at 3:53 am
SQLRO (5/20/2011)
Thanks for the reply.
The records will not be actually preassigned. The records will be allocated sequentially& dynamically i.e. any top 10 records should be assigned which are...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 20, 2011 at 3:46 am
Hi Rohit
This looks like a scheme for selecting and using preassigned numbers for use as identity values in a table - is this the case?
Cheers
ChrisM
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 20, 2011 at 3:25 am
ursfriend77 (5/16/2011)
WHERE 1=1
AND md.vendor_id=sd.vendor_id(+)
AND md.inventory_id=sd.item_id(+)
Here i am using 2 tables main_data and sub_data, as for join rules we have to give n-1 join conditions,...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 17, 2011 at 2:44 am
abhisheksrivastava85 (5/16/2011)
Thanks a lot for reply man, but it is returning average as 0 when i am using Sign function.
Check your data and then your code. The method works just...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 16, 2011 at 11:37 am
SkyBox (5/16/2011)
That works, but unfortunately the data is for accounting - So rounding is not an option.
How does the system deal with VAT?
Is the datatype really varchar? If it is,...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 16, 2011 at 8:20 am
Ninja's answered the question you originally posted - it's straightforward enough to write a query which will do what you are asking.
Expanding upon his comments, you need an intimate knowledge...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 16, 2011 at 6:26 am
How confident are you that a column in one table which has a name matching the pk column in another table is a foreign key?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 16, 2011 at 4:15 am
Work on the inner query
select stud_code,count(*) Num_Absences
from StudAbsent
where Absent_date between @StartDate and @EndDate
and cmpy_code='10'
group by stud_code
having count(*) > 2
until you are certain that the result...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 16, 2011 at 1:17 am
Ray K (5/13/2011)
Brandie Tarvin (5/13/2011)
WOTD:Editededited😀
:laugh: :laugh: :laugh:
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 13, 2011 at 6:59 am
GilaMonster (5/10/2011)
terrykzncs (5/10/2011)
I know that SQL joins tables from left to right, but in what order should we join tables for the code to be most efficient?
Any order you like....
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 13, 2011 at 6:21 am
Is 29,999,999,997 rows representative of the data you wish to model? Or, with 10 names to start, 99,999,999,990 rows? Is the data itself representative?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 13, 2011 at 6:00 am
BinaryDigit (5/13/2011)
thank you, so it doesn't have to be completely different values just that they are unique?
One or the other will do just fine 😉
Jeff Moden has a sample data...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 13, 2011 at 5:31 am
Viewing 15 posts - 826 through 840 (of 1,228 total)