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

Emulate NULL direction for MSSQL

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.22.0
    • 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

              Unassigned Unassigned
              jswett Justin Swett
              Votes:
              0 Vote for this issue
              Watchers:
              3 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