Viewing 15 posts - 256 through 270 (of 1,923 total)
Try this!
DECLARE @Example
TABLE (
row_id INTEGER IDENTITY PRIMARY KEY,
...
April 10, 2012 at 9:14 am
dwain.c (4/9/2012)
DECLARE @FakeItems TABLE (Item_Code nvarchar(20), Superseeds nvarchar(20))
INSERT @FakeItems (Item_Code, Superseeds)
SELECT 'Abc8',NULL UNION ALL
SELECT 'Abc9','Abc8' UNION ALL
SELECT 'Abc10','Abc9' UNION ALL
SELECT 'Abc11','Abc10'
DECLARE @FakeInvoice TABLE...
April 9, 2012 at 8:26 pm
One last question, how to determice abc10 and abc11 are base for the data sets 1 and 2 respectively ?
April 9, 2012 at 6:12 pm
Good, with the sample data, sample structure, and the desired result, im sure we will be able to help you out!
And don forget to take a peek at the article...
April 9, 2012 at 5:38 pm
Can you set up sample tables and sample data for us to work on your query?
Also, are u asking how to design the table structure or how to retreive the...
April 9, 2012 at 4:49 pm
Please follow the following link to know more on how to post data in readily consumable format.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Without your data, we will have hard time figuring out what do you...
April 9, 2012 at 12:52 pm
mymail.default (4/9/2012)
where ID = 1334802
Is the ID value parameter-driven? Or even in your SP u hard-code 1334802 ? [Dumb question, i know :-D]
April 9, 2012 at 12:24 pm
Lynn Pettis (4/9/2012)
mymail.default (4/9/2012)
Little stumped!
Have a simple select stmt (SQL 2008):
1. Returns the correct result when ran alone in management studio
2. Returns a value (this value was...
April 9, 2012 at 12:17 pm
This?
; WITH CTE AS(
SELECT * , RN1 = ROW_NUMBER() OVER (ORDER BY lastD DESC)
, RN2 = ROW_NUMBER() OVER (ORDER BY...
April 6, 2012 at 6:24 pm
This?
declare @tab table
(
ItemId int
, IsProduced int)
insert into @tab
select 101 ,1
union all select 102 ,0
union...
April 6, 2012 at 6:01 pm
Your OR operator is evaluated against each row.
Assume your @ItemID 16 is present in 3rd row of your table ( table contains only 5 rows, lets assume)
ItemID
22
23
16
42
52
So when the query...
April 6, 2012 at 3:34 pm
Column missing in the table ( Your insert statments have 8 columns but ur table has 7 ) cna you fix it?
April 6, 2012 at 3:13 pm
How about this?
; WITH CTE AS
(
SELECT RN = ROW_NUMBER() OVER(ORDER BY DST.StopName) , DST.StopName, DST.dist
FROM distancetest1 DST
)
,ListOfStops AS
(
SELECT FromStop = OutQ.StopName
...
April 6, 2012 at 1:53 pm
Can you give the expected results based on your sample data? You have given a skelton of the desired result, but can u populate the expected results with the values...
April 6, 2012 at 12:51 pm
Whats the logic to find the distance betwen A and C ? is it ( A to B ) + (A to C) or is it value of distance in...
April 6, 2012 at 12:51 pm
Viewing 15 posts - 256 through 270 (of 1,923 total)