Viewing 15 posts - 346 through 360 (of 582 total)
PW you assume dates are unique within a group. Not a very safe assumption, esp. if there's no time portion, or frequent transactions.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
Do you want the earliest of the records, latest, don't care? If you want first or last, how will you break ties? If you don't care which record you keep it...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
Agreed. Applies to all other identifiers as well as table and column names.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
I don't think it will work. Look at the syntax in BOL:
< generation_term > ::=
FORMSOF ( { INFLECTIONAL | THESAURUS } , < simple_term > [ ,...n ] )...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
What datatype is the field? Text or a character datatype? Charindex doesn't work on text.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
Not in TSQL you can't.
[edit: oh i see it's a UDF. There are better ways of splitting strings though. But this request was not about doing that anyway.]
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
5 most recent sales to whom, of what?
The (scalar) UDF in a SQL statement acts like a correlated subquery. Just as the subquery is joined on Customer and Item, the...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
Here's one way of doing it in a single SQL statement, but it's fairly messy and essentially the same as the UDF method. Might give the optimiser some scope for improvement over...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
Yes with small recordsets the impact of inefficient code can be negligable.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
Viewing 15 posts - 346 through 360 (of 582 total)