Viewing 15 posts - 5,086 through 5,100 (of 8,731 total)
GilaMonster (3/27/2015)
Luis Cazares (3/26/2015)
By the way, about the article that Gail posted where they mention a comic book cover. I found that discussion out of place.
Yeah, that protest is...
March 27, 2015 at 10:00 am
You shouldn't store the information in either format as neither way is normalized.
Assuming your current data is something like this:
CREATE TABLE TestData(
Expenses varchar(20),
...
March 26, 2015 at 7:12 pm
As I understand, you don't want to pivot your rows. You just want a list in a single column. If that's true, try the option explained in here:
http://www.sqlservercentral.com/articles/comma+separated+list/71700/
If you really...
March 26, 2015 at 11:06 am
I've bee trying to post about the gender bias, but every time I get distracted.
I find it really absurd that it happens. Why would you expect someone to be better...
March 26, 2015 at 10:37 am
There's no need to apologize as you're new here. But it's a good practice to do if you want to attract more answers faster. We use the tables and sample...
March 26, 2015 at 9:57 am
Some people do something like this:
--If object doesn't exist, create a dummy object
IF OBJECT_ID('dbo.InexistentFunction') IS NULL
EXEC('CREATE FUNCTION InexistentFunction()
...
March 26, 2015 at 9:55 am
Just another way to get this result.
SELECT num
FROM #letters
WHERE letter IN('A', 'B')
GROUP BY num
HAVING COUNT( DISTINCT letter) = 2
March 26, 2015 at 9:42 am
This is a gaps and islands problem. You can read about many solutions on the internet.
Here's an example with my preferred method.
CREATE TABLE PatientsLocations(
Patient ...
March 25, 2015 at 4:07 pm
Of course, everything becomes easier on 2012+ with PERCENTILE_DISC and PERCENTILE_CONT analytic functions.
March 25, 2015 at 12:30 pm
I adapted some code by Itzik Ben-Gan to generate the values you need. The original code and explanation is posted in here: http://sqlmag.com/t-sql/calculate-percentiles
DECLARE @mark-3 AS INT;
SET @mark-3 = 90;
WITH...
March 25, 2015 at 12:16 pm
Scott's code doesn't return the same results as your query every time.
Here's my test:
DECLARE @SearchId INT = 100 --Changed to 300 and 400
CREATE TABLE Customer(
CountyID int
)
INSERT...
March 25, 2015 at 11:26 am
You're really close Thomas.
Ranking functions (ROW_NUMBER, RANK, DENSE_RANK, NTILE) need the OVER clause with ORDER BY. As I don't care about the order and I can't use a constant, the...
March 25, 2015 at 9:41 am
Koen Verbeeck (3/25/2015)
Have fun updating that SQL statement every year 😉
Or create a dynamic version 🙂
March 25, 2015 at 9:23 am
Alan.B (3/24/2015)
Luis Cazares (3/24/2015)
WITH Letters AS(
SELECT TOP 26 CHAR(ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) + 64) letter
FROM sys.all_columns
)
SELECT DISTINCT...
March 24, 2015 at 4:37 pm
Viewing 15 posts - 5,086 through 5,100 (of 8,731 total)