Viewing 15 posts - 1,201 through 1,215 (of 3,480 total)
Oh fun!
This sounds like it's the end part of some dynamic SQL statement, so you need to track down exactly what query is being built, so you know the...
October 15, 2018 at 2:41 pm
the other option is to OUTER join to your Calendar table.
...
FROM Calendar c LEFT JOIN Sales s
ON c.CalendarDate = s.SaleDate
because that forces a value...
October 12, 2018 at 1:42 pm
September 26, 2018 at 9:07 am
Take this with a grain of salt, because I'm a SQL Server dummy, but I'd probably create a cursor to loop over the tables in your database that you want...
September 25, 2018 at 11:56 pm
SELECT TOP 2 PERCENT :<column list>
FROM ...
September 25, 2018 at 8:18 am
If all you want is the previous value, then why not just use LAG()? For the first value in the PARTITION BY clause, it will be NULL. For all others,...
September 19, 2018 at 1:42 pm
September 19, 2018 at 10:34 am
Did you rebuild the indexes after the shrink? That would do it.
September 17, 2018 at 9:32 pm
Why not just add a sort of phony column for each of the two sets. For the book income, set the value = 1 and for the other set the...
September 17, 2018 at 3:56 pm
Why would you want to avoid EXISTS? That's a really odd requirement. Is this a homework assignment?
The great thing about EXISTS is it reads until it finds a disqualifying...
September 16, 2018 at 11:50 pm
Oh, come on. What database is this coming from???
It looks like it's one of the Microsoft ones, but which one? Is it the 2014 version of AdventureWorks?
Without...
September 16, 2018 at 8:44 pm
Sorry, my psychic powers are off for the weekend. What database are you using? It sounds like a sample MSFT database, but since you don't specify, I'm not sure.
Where/how...
September 16, 2018 at 7:40 pm
Views don't accept parameters, but stored procedures do.
Jeff Moden has some articles on doing crosstabs in T-SQL... You can use PIVOT too.
Here's an article...
September 12, 2018 at 6:14 pm
What have you tried so far? People here will help you if you make an honest effort.
Pretty good job posting data... but CREATE TABLE and INSERT scripts will get...
September 9, 2018 at 9:50 pm
Viewing 15 posts - 1,201 through 1,215 (of 3,480 total)