Forum Replies Created

Viewing 15 posts - 196 through 210 (of 1,419 total)

  • Reply To: T-SQL | Group Invoices with concern dates that overide the issue date

    Phil Parkin wrote:

    This took a while, but was fun! There are a couple of characters in this forum who like to come along and make my code run 17 times faster,...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Select a distinct list of values from tables, return the dataset

    Phil Parkin wrote:

    ... it assumes that you know in advance which of the columns has the most distinct items ('Line' in your example, but 'Division' in mine).

    One way to generalize the...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Opening and closing with date filter is not giving me correctly output

    Ok the set up and explanation are appreciated.  Right off the bat tho there's an issue (which is hopefully a typo) with the sample data.  In the #tbl_transection table in...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Opening and closing with date filter is not giving me correctly output

    akhterhussain80 wrote:

    I want ...

    Keep at it you're on the right track.  Your query doesn't seem to return any error so what's the question?  What's Wrong Output and Correct Output seems...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Need help on query within 2 column, generate another column

    It appears the math in your example calculation is off (by 300.00) beginning on line 3: instead of 21.37 should it not be 321.37?

    select 21.37 + (11033.21)...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to Implement

    Is x a column in table A?  It seems so.  The SQL language does not support dynamic join types or JOIN conditions derived within a WHERE clause based on CASE...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: extracting data from JSON with TSQL

    Ken McKelvey wrote:

    There is probably a better method:

    Well I came up with pretty much the identical query.  Joining the rows back together using the array keys seems unavoidable.  In SQL Server...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Get the change record details with flag

    If I'm understanding then perhaps an INSERT statement and an UPDATE statement.  Possibly it could also be done using a MERGE statement however I don't use such syntactic sugar.  Also,...

    • This reply was modified 2 years, 12 months ago by Steve Collins. Reason: Renamed CTE to more clearly reflect its purpose

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Are the posted questions getting worse?

    Author Joe Booth gives SSC a nice mention in this YouTube video at about the 11:11 mark.  The channel is Syncfusion which afaik is a .NET UI kit vendor (which...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Security: Dynamic Order By clause using sp_executeSql

    Curious, why not create 2, 4, or ?? procs instead?  Instead of enums in C#, a UDT, and dynamic SQL could you not get rid of the parameterization and just...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Help With Database Design

    If I'm understanding then imo there are possibly some non-modelled attributes and/or relationships. Also, when the spec says to record the address at the time of the transaction imo that...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: SQL Query

    Jeff Moden wrote:

    Understood.  For me, performance is 2nd only to a correct result... and its a very, very close second and I, having learned many painful lessons about it in the...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: how to get more than one column in one column with distinct value.

    rajemessage 14195 wrote:

    So I thought to unpivot and then find the distinct and thereafter pivot it again. Which is lengthy.

    Yes imo you've got the right ideas unpivot and re-pivot is what's...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: SQL Query

    DENSE_RANK is the better solution in this case though.  Good on Drew it's another interesting one

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: SQL Query

    Yes sorry, I didn't save that gpt context.  Iirc I posted the question in its entirety and asked for sample data and a solution.  The query it came up (which...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

Viewing 15 posts - 196 through 210 (of 1,419 total)