Viewing 15 posts - 8,671 through 8,685 (of 8,730 total)
ColdCoffee (7/30/2012)
sestell1 (7/30/2012)
LEN(Reverse(<string>) is a quick and dirty way to find the length of a string INCLUDING trailing whitespace.
Instead, you can use DATALENGTH function to get the length, inlcuding white...
July 30, 2012 at 1:55 pm
Thanks Sean, but I was joking with this because I'm not sure palindromes count as a "practical application".
July 30, 2012 at 12:33 pm
You can use it to check if 2 phrases are palindromes.
Just kidding.
July 30, 2012 at 11:36 am
It's important to give all the information possible in the first post, otherwise the solutions might not be completely accurate.
Here are 2 solutions with DDL and sample data (something that...
July 30, 2012 at 11:10 am
How would you define "the first ocurrence"?
I'm not sure if this is the best place to search for that answer, as the best solutions would be oriented on MS SQL...
July 30, 2012 at 10:11 am
Thanks Jared, I think I couldn't have explained that well.
Of course, I know what I'm doing but I have problems to explain when I see some things that might look...
July 30, 2012 at 9:22 am
This could be easier to translate (if even needed)
DECLARE @tTabletable(
IDint,
namevarchar( 20));
INSERT INTO @tTable
SELECT 1275, 'Customer A' UNION ALL
SELECT 3472, 'Customer A' UNION ALL
SELECT 2812, 'Customer A' UNION ALL
SELECT 1245, 'Customer...
July 30, 2012 at 7:03 am
Do you really need the first '%'?
That prevents you from using an index (As far as I know).
If you could drop it, the query would speed up.
July 26, 2012 at 1:54 pm
Yes, it's possible.
Look for "subqueries" or "Common Table Expressions (CTE)"
July 26, 2012 at 8:01 am
You could simply drop the conditions and the union.
SELECT EID,
[Status],
MAX(EDate) AS EDate
FROM TheTable
WHERE [Status]='cp'
GROUP BY EID,[Status]
ORDER BY EID,[Status]
It should...
July 26, 2012 at 7:38 am
SQL_NuB (7/25/2012)
Its returning me 0 for my counts
You should post DDL and sample data, so we can compare results.
Added: Also post the query that returned 0 for the counts.
July 25, 2012 at 1:32 pm
I'm curious Lynn,
You presented the first solution just because it would be a correction of the original query?
Because it seems to me that it would give terrible performance compared...
July 25, 2012 at 1:28 pm
That's the problem we face when SQL Server does not use the same datatypes for all of its tools.
the value you're looking for should be: true (with no quote marks).
I'm...
July 25, 2012 at 9:04 am
xmozart.ryan (7/25/2012)
thx for share it,, but i'm really sorry coz i cannot understand what is it ??:crazy:
*once again i'm really newbie on SS..
Try printing the code stored in @DynamicSelect and...
July 25, 2012 at 8:32 am
Viewing 15 posts - 8,671 through 8,685 (of 8,730 total)