Viewing 15 posts - 436 through 450 (of 683 total)
Use group by and some summary function. e.g.
SELECT Room,
max(CASE Period WHEN 1 THEN Description ELSE NULL END) AS 'Period 1',
max(CASE Period WHEN 2 THEN Description ELSE NULL END) AS 'Period...
May 23, 2006 at 4:51 am
I should mention something about the pros and cons of the 2 methods we've got here (the one I gave, and the one David gave). The method I gave should...
May 23, 2006 at 4:06 am
You're too kind, Sergiy.
The difference is just that column x is included. I know it's not difficult - I was just trying to explain (to myself and others) why A had...
May 23, 2006 at 2:56 am
You shouldn't need to reinvent the wheel. Use something like this (and modifiy slightly, if necessary)...
May 22, 2006 at 12:36 pm
Hi Chris,
The calculations thing shouldn't throw you off - most of the examples are not really about calculations, that's probably just the max keyword trick you're seeing.
Here's how you can...
May 22, 2006 at 11:41 am
I guess it's Nigel you should be thanking!
May 22, 2006 at 11:10 am
It looks like you're asking for a pivot/crosstab query. You can search this site for that to find several related questions.
I find this (or something based on it) to be handy for...
May 22, 2006 at 10:58 am
If you use the datetime data type (and you should!), the stored format is irrelevant. The format you use to query those fields is a different matter.
This answers your question...
May 22, 2006 at 10:23 am
Here's one technique you can use...
If this isn't what you want, please explain some more.
--data
if object_id('tempdb.dbo.#t') is not null...
May 22, 2006 at 10:14 am
Hi all,
What a confusing question!
If I've managed to understand it correctly, here's my suggestion. I've changed the data to (hopefully) make it a...
May 22, 2006 at 8:46 am
I don't know, you try to teach a man to fish, and someone hands him their catch...
May 17, 2006 at 10:08 am
To solve this kind of problem, I would recommend the following approach:
1. Simplify it until you find something which works
2. Build it up bit by bit until it breaks
3. Figure a...
May 17, 2006 at 10:02 am
Viewing 15 posts - 436 through 450 (of 683 total)