Forum Replies Created

Viewing 15 posts - 436 through 450 (of 4,085 total)

  • Reply To: update query help

    pietlinden wrote:

    This looks like it works...

    CREATE TABLE #Test(
     col1 int,
     col2 int,
     col3 int);
    GO
    INSERT INTO #Test VALUES
     (1, 203, 1232)
    ,(2, null, 2343)
    ,(3, 502, 15566)
    ,(4, null, 4566)
    ,(5, null, 4545)
    ,(6, 601, 4545)
    ,(7,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: update query help

    This is the approach.  You can use CHAR instead of BINARY, but then you have to worry about padding the strings so that the MAX() works correctly.  You can also...

    • This reply was modified 6 years, 9 months ago by drew.allen.

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: update query help

    SQL Tables represent sets which are UNORDERED.  There is no concept of "values that exist right before it", because there is no concept of "before". You have to specify some...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Are the posted questions getting worse?

    One of our groups is using MongoDB and we got a notice that we're evaluating making it more widely available.  In the announcement was a link to a course we...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Deriving covered date ranges for drug Prescription data (without using a cursor)

    This is a packing intervals problem, not a gaps and islands problem. The two are different, but related.

    Please provide sample data and expected results. We can't run your query, because...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Displaying Checkbox Values and Best Data Structure

    rjjh78 wrote:

    Thanks again!  So are you saying the table structure in my example would be OK for data storage, but instead of using checkboxes at the UI level, use a...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Displaying Checkbox Values and Best Data Structure

    ScottPletcher wrote:

    Typically one would use a bit value setting to reduce space usage.  For example:

    languages int NOT NULL

    You'd want a separate table with the language code values:

    CREATE TABLE #language_codes (...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Displaying Checkbox Values and Best Data Structure

    rjjh78 wrote:

    This is interesting, how would I do this?  Would I still have a field for each option?  Or would I store a string of values into 1 table?

    drew.allen wrote:

    separate...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Issue with max() and aggregate, missunderstanding

    jcelko212 32090 wrote:

    I will be honest about this. I am one of the few people who actually sits down and reads ANSI/ISO standards. They are incredibly dull, and you need to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Displaying Checkbox Values and Best Data Structure

    You've designed this in such a way that it's cumbersome to add new languages.  Checkboxes requires you to update your web form and having a separate column requires you to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Help with Query Results and Collation

    Mike Scalise wrote:

    I should know the answer to these questions, but I'm having trouble with a couple of my queries.

    First, my goal here is to compare data from a table in...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Convert Seconds to Minutes

    DesNorton wrote:

    Why are your seconds stored as strings? Convert them to integers, then this should do the trick.

    SELECT  *, [HH-MM-SS] = CAST(DATEADD(SECOND, l.Seconds, 0) AS time(0))
    FROM...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Are the posted questions getting worse?

    Steve Jones - SSC Editor wrote:

    jasona.work wrote:

    And yet another week of dealing with the "anti-virus" virus...

    ...

    So how was your day?

    Good and bad. worked a bit and then spent the last day and evening with...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Left join with same tables multiple times displaying the data into multiple rows

    You haven't said what you are using to display this information.  It may be (much) easier to do this in your presentation layer than the database layer.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Reply To: Are the posted questions getting worse?

    Jeff Moden wrote:

    ZZartin wrote:

    Speaking of website issues, is the bug where you have to unsubscribe from email notifications to a topic every time you reply going to be fixed?

    I personally don't...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 436 through 450 (of 4,085 total)