Forum Replies Created

Viewing 15 posts - 6,166 through 6,180 (of 8,731 total)

  • RE: Monthly data

    Ideally, you would have a calendar table to join your data table. If you don't, you can build one on the fly with a CTE similar to a tally or...

    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: Handling Nulls in a PIVOT

    That's the beauty of cross tabs. When you need more information than a simple pivot will give, the cross tabs approach will be more flexible and cross tabs shows more...

    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: Select all columns from table in view with GROUP BY

    You might be able to use a different query by using cross apply. However, it might be worse for performance.

    The correct option is to write all the columns in 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 over multiple columns using the 1.1, 1.2, 2.1, 2.2 sequence

    Could you post DDL, sample data (as insert into statements) and expected results based on that data? You can read the article linked on my signature to know how to...

    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: Handling Nulls in a PIVOT

    You can use ISNULL() on each column pivoted (ISNULL([Oranges], 0) as Oranges) or you could try a pre-aggregated Cross tab which might give you a performance boost.

    SELECT SalesPerson,

    ...

    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?

    Stefan Krzywicki (7/7/2014)


    Luis Cazares (7/7/2014)


    patrickmcginnis59 10839 (7/7/2014)


    Luis Cazares (7/7/2014)


    I'll start using Oracle :sick: at my job. As a SQL/BI Developer, it seems that most of the knowledge can be transferred...

    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?

    Eirikur Eiriksson (7/7/2014)


    Luis Cazares (7/7/2014)


    I'll start using Oracle :sick: at my job. As a SQL/BI Developer, it seems that most of the knowledge can be transferred easily between tools, but...

    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?

    patrickmcginnis59 10839 (7/7/2014)


    Luis Cazares (7/7/2014)


    I'll start using Oracle :sick: at my job. As a SQL/BI Developer, it seems that most of the knowledge can be transferred easily between tools, but...

    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: Function Calls two other functions - If, else - then used in View - Is it OK or can it be improved

    The problem is that you're still thinking of procedural programming, there's nothing wrong on thinking like that, but you should change it when working with SQL. If you use a...

    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: The "Numbers" or "Tally" Table: What it is and how it replaces a loop.

    sqldriver (7/7/2014)


    Jeff Moden (7/7/2014)


    Luis Cazares (7/7/2014)


    david.holley (7/7/2014)


    Jeff Moden (7/7/2014)


    jfogel (7/7/2014)


    Great, just great. A year ago I wrote something that has to break down a CSV-style parameter string and it uses...

    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'll start using Oracle :sick: at my job. As a SQL/BI Developer, it seems that most of the knowledge can be transferred easily between tools, but I'm just starting to...

    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: Counting rows from last date

    I'm not sure if you're expecting something like this.

    CREATE TABLE PSITableFinal

    (DivisionRegion char(1),

    PSIYear char(4),

    PSIMonth ...

    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?

    wolfkillj (7/7/2014)


    Luis Cazares (7/7/2014)


    wolfkillj (7/7/2014)


    Sean Lange (7/2/2014)


    Stefan Krzywicki (7/2/2014)


    Sean Lange (7/2/2014)


    Stefan Krzywicki (7/2/2014)


    Koen Verbeeck (7/2/2014)


    Jo Pattyn (7/1/2014)


    Funny! :w00t:

    Anyway the Belgium Red Devils got past the USA soccer team after a...

    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: Function Calls two other functions - If, else - then used in View - Is it OK or can it be improved

    Is the value from Id_Wells on Wells table unique? Or can it have duplicates?

    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?

    Is he serious?

    http://www.sqlservercentral.com/Forums/FindPost1589994.aspx

    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 - 6,166 through 6,180 (of 8,731 total)