• shaulbel - Tuesday, February 20, 2018 11:36 PM

    Seems it works now.

    I would like to understand the query

    select RowNum, [1],[2],[3],[4],[5],[6],[7],[8],[9]
    from
      (select RowNum, ColumnNum, case when substring(@PuzzleIn,CoordinateID,1) != 0 then substring(@PuzzleIn,CoordinateID,1) end Value from #tGrid) as base
    pivot
    (min(Value) for ColumnNum in ([1],[2],[3],[4],[5],[6],[7],[8],[9])) as pt

    what is the meaning of !=0
    Thanks

    Hi Shaulbel

    Since the puzzle is first parsed with 0 in the place of the unsolved cells they do need to be displayed hence the case statement.
    Try replacing the case statement with 
    substring(@PuzzleIn,CoordinateID,1) Value
    and it will show you the zeros too.

    Cheers
    Bevan