Viewing 15 posts - 1,561 through 1,575 (of 1,825 total)
Hi
SQL is not good at pivoting data , even with the PIVOT operator you have to know your finite list of columns.
Take a look at BOL (Books online) for...
September 1, 2009 at 3:41 am
Please post DDL and sample data that shows your issue and i'll take a look
September 1, 2009 at 3:38 am
Dave Ballantyne (9/1/2009)
Dont take this the wrong way
Obviously you did take it the wrong way, pardon me for attempting to find out what your level of knowledge is.
September 1, 2009 at 3:37 am
You can still use Min and Max on varchar columns, does that help ?
September 1, 2009 at 3:30 am
john.imossi (9/1/2009)
This runs but it returns no data, I'm surprised it will run at all to be hoenst. When I used to create something similar to this in Oracle...
September 1, 2009 at 3:08 am
Check out my blog here http://sqlandthelike.blogspot.com/2009/03/blog-post.html for how to build the contiguous range, then its a case of taking the inverse.
August 27, 2009 at 2:46 pm
Hi Riz,
row_number() is documented in bol and returns an incrementing number.
DayMask is a column in my table 1=Monday , 2=Tuesday , 4 = Wednesday , 8 =Thurs etc....
and as...
August 27, 2009 at 2:42 pm
Hi ,
getdate() will give you the current datetime then
see BOL (books online) for the Dateadd statement
August 27, 2009 at 10:17 am
Try this link
August 27, 2009 at 7:18 am
This is all you need to know about concatenating strings
http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/
August 27, 2009 at 7:17 am
You cant im afraid.
If its unique its unique
http://msdn.microsoft.com/en-us/library/ms175132(SQL.90).aspx
Maybe the best thing would be to split this column out to another table and reference it back to this table.
August 27, 2009 at 6:26 am
FredS (8/27/2009) but based on differing criteria.
Thats the key here, sql is not designed to easily (perhaps more importantly efficiently) do that.
You could try dynamic SQL http://www.sommarskog.se/dynamic_sql.html
or a...
August 27, 2009 at 6:00 am
Andy Hogg (8/27/2009)
In a phone book data is sorted in...
August 27, 2009 at 5:14 am
Hi Fred,
did something go wrong with your post ?
The code segments look the same.
August 27, 2009 at 5:02 am
Heres a good resource on calendar tables
Its just a simple query DayMask = 1 Means Mondays ,WeekNo is encoded as YYYYWW
with cteWeeks(dte,WeekNo,RowN)
as
(
Select dte,WeekNo,row_number() over (order by dte)
...
August 27, 2009 at 3:26 am
Viewing 15 posts - 1,561 through 1,575 (of 1,825 total)