Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3370

Emulate NULL direction for MSSQL

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.22.0
    • Component/s: None

      Description

      MSSQL cannot handle NULLS LAST/FIRST and should emulate the NULLS LAST/FIRST in order by, i.e.

      --for nulls last

      select [column] from [table]  ORDER BY CASE WHEN [column] IS NULL THEN 1 ELSE 0 END, [column]"

      --for nulls first

      select [column] from [table]  ORDER BY CASE WHEN [column] IS NULL THEN 0 ELSE 1 END, [column]"

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jswett Justin Swett
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m