Viewing 15 posts - 856 through 870 (of 1,347 total)
Presumably your "derived table" has a column that indicates which source system the data came from ?
There is a pretty generic pattern that can solve this, and it can be...
December 13, 2005 at 1:12 pm
Forum search on keyword "Pivot":
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=238656#bm238751
December 9, 2005 at 3:58 pm
Isn't this the exact same question as on your other thread ? Can we let this old thread rest in peace now, and continue the discusssion on your new thread ?
December 9, 2005 at 1:26 pm
Replace table/column names with the appropriate names for your table.
Select Distinct A.*
From YourTable As A
Where Exists (
Select *
From YourTable As B
Where A.FN = B.FN
And A.LN = B.FN
...
December 9, 2005 at 1:20 pm
>>Is the index needed?
Every table should have a clustered index, so in that sense, yes.
The solution would seem to be to drop the index and make the Primary Key clustered. Or alternatively,...
December 8, 2005 at 4:45 pm
>>You're right... I just dropped that in during some testing .. .forgot to take it out before posting.
I'm now thoroughly confused.
The original question was why you couldn't filter on this...
December 8, 2005 at 11:54 am
In your COMPUTE, you have several itmes like this: Sum(dt1).
The SUM() aggregate function expects a column name, but you are giving it a table name. It needs to be SUM(dt1.SomeColumnName)
December 8, 2005 at 10:55 am
But then you had a filter, looking for only the word 'Flag' ?
If the intention was to show some records as 'Flag' and some records as 'OK', why the filter...
December 8, 2005 at 10:49 am
You don't use expressions in the SELECT to set flags, if the only purpose of those flags is to filter.
Filtering is done in the WHERE, so place the filter expression...
December 8, 2005 at 10:33 am
Please look at the original SQL:
ConcStatus =Case
Notice the = ? That is old-style SQL syntax for assigning an alias to an output column in the resultset....
December 8, 2005 at 10:22 am
ConcStatus is a column alias, assigned to an expression in the SELECT portion. You can't reference this alias in the WHERE, ORDER BY or GROUP BY.
If you need it in the...
December 8, 2005 at 9:11 am
>>the total of the integer values from the LOS field
What datatype is the LOS column, and what does it typically contain ? What does "integer value" mean ?
Is it...
December 7, 2005 at 5:48 pm
Append this to the 1st query ...
Union All
Select A.Product_id, A.Purch_Date, NULL, [repeat as many Nulls as you need]
From A
Where Not Exists (
Select * From B
Where B.Product_id = A.Product_id
...
December 7, 2005 at 12:30 pm
More info would be useful.
Why do you need a GUID ? Are you synchronising this data across multiple sites, or exchanging it with other external entities ? If not, just...
December 7, 2005 at 10:48 am
Viewing 15 posts - 856 through 870 (of 1,347 total)