Forum Replies Created

Viewing 15 posts - 5,086 through 5,100 (of 8,731 total)

  • RE: Are the posted questions getting worse?

    In a different order of ideas, I want to share with you my happiness.

    Starting on April 21st I'll be working in the US. I'll make a stop at Miami on...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: pivot rows and columns in the same query

    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),

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: T-SQL Pivot

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Tricky problem

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: any way to return from script instead of drop existing for ddl scripts?

    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()

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Brain freeze.

    Just another way to get this result.

    SELECT num

    FROM #letters

    WHERE letter IN('A', 'B')

    GROUP BY num

    HAVING COUNT( DISTINCT letter) = 2

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Tricky problem

    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 ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: percentile

    Of course, everything becomes easier on 2012+ with PERCENTILE_DISC and PERCENTILE_CONT analytic functions.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: percentile

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Elegant way for returning all results when subquery returns no results?

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Help with finding multiple Character Occurence in String

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pivot for Multiple Metrics by Year

    Koen Verbeeck (3/25/2015)


    Have fun updating that SQL statement every year 😉

    Or create a dynamic version 🙂

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Help with query

    Have you tried to use a subquery or CTE?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 5,086 through 5,100 (of 8,731 total)