Viewing 15 posts - 376 through 390 (of 1,228 total)
WolfgangE (1/14/2013)
The disadvantages using the cross-apply-method I see are performance and maintenance:
If the number of rows of the outer select increases the query will slow down as the apply-operator does...
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]
January 14, 2013 at 5:39 am
Hi Paul
Your sample data set doesn't have a matching row between MG_VSLVOY_HEADER and MG_VSLVOY_PORT_CONTROL:
SELECT ncv.*, vh.VSLVOY_HEADER_ID
FROM NCV_BL ncv
JOIN MG_VSLVOY_HEADER vh
ON ncv.saisan_VESSEL_CD = vh.VESSEL_CD
AND ncv.saisan_VOYAGE_CD = vh.VOYAGE_NUM
AND ncv.saisan_LEG_CD =...
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]
January 13, 2013 at 2:06 am
select x.NewSid, sid
from tbl_xenix
CROSS APPLY (SELECT NewSid = ('S'+CAST ([statusId] AS VARCHAR(255)))) x
order by CHARINDEX(x.NewSid,'S5S4')
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]
January 13, 2013 at 1:39 am
terrygefael (1/5/2013)
I have a simple table with 29 fields(unique id, 14 True/False, 14 text)
I want to find all fields relating to one unique ID that are true.
Example:
SELECT...
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]
January 6, 2013 at 12:44 am
Use CROSS APPLY.
SELECT
x.Results1,
CASE WHEN x.Results1 > 42 THEN ...
FROM ...
CROSS APPLY (SELECT... VERY LONG FORMULA as Results1) x
WHERE x.Results1 =...
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]
January 5, 2013 at 11:55 pm
Read the link in my sig (please read this) to see how to generate and post readily-consumable sample data. If folks can get to work on your problem using cut-and-paste...
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]
November 4, 2012 at 12:58 pm
Where in this code do you populate table #sid?
sqldba_newbie (10/28/2012)
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]
October 28, 2012 at 11:54 am
jrichards54 (10/28/2012)
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]
October 28, 2012 at 10:48 am
L' Eomot Inversé (10/27/2012)
L' Eomot Inversé (10/26/2012)
WayneS (10/25/2012)
Anyone still alive out here? 3 days with no comments... that has to be a record for The Thread.
Some malware has reduced my...
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]
October 28, 2012 at 5:58 am
Revenant (10/27/2012)
crookj (10/26/2012)
Brandie Tarvin (10/26/2012)
RatBen
MJ song
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]
October 28, 2012 at 5:17 am
scarlam (10/24/2012)
Any ideas on how to go about writing a script or stored procedure that can loop through this table.
You're a programmer, you work to a specification -...
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]
October 28, 2012 at 5:06 am
dthmtlgod (10/15/2012)
I only want the records with a 1 and not a 5 status
;WITH SampleData (TICKET, [STATUS]) AS (
SELECT 9543, 1 UNION ALL
SELECT 9543, 5 UNION ALL
SELECT 9543, 5 UNION...
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]
October 28, 2012 at 4:24 am
Don. (10/28/2012)
ChrisM@home (10/28/2012)
Thanks for the feedback, Don. The script in bold - is it the 2000-compatible one?
Morning Chris,
It was the following script you gave me help with:
SELECT c.*, h.* ...
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]
October 28, 2012 at 4:15 am
Don. (10/28/2012)
ChrisM@home (10/17/2012)
Eric M Russell (10/15/2012)
If Don has time, it would be interesting to know how this triangular join method compares to the aggregate methods. With small partitions it could...
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]
October 28, 2012 at 3:54 am
-- if this returns a few thousands of rows or more;
SELECT RTRIM(referencia) referencia FROM arttamcor GROUP BY referencia
-- then consider setting it up as a temp table:
SELECT RTRIM(referencia) referencia
INTO...
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]
October 28, 2012 at 3:23 am
Viewing 15 posts - 376 through 390 (of 1,228 total)