Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    the differences between RANK, DENSE_RANK and ROW_NUMBER are how they handle dups.

    Rank- Unique Rank for each row, dupes skip the next rank. Eg: 1, 2, 3, 3, 5. Rank 4 is skipped.

    Dense Rank- Unique Rank for each row but Dupes aren't skipped. Eg, 1, 2, 3, 3, 4, 5. Rank 4 isn't skipped, it comes after the dupes.

    ROW_NUMBER- Unique rank for each row regardless of dupes. Every row gets ranked in order, duplicates are ignored. Eg, 1, 2, 3, 4, 5, 6.

  • Custom User Avatar

    Did you change the order by statement? Got a similar error and it was resolved after i cahnged the order by to average_salary.

  • Default User Avatar

    Hi, Amna. CONCAT_WS() is just like CONCAT() but you get to set a separator beforehand -- lemme explain. If I want to print out:
    'I-like-cats' I can do it as follows:
    SELECT
    CONCAT_WS ('-', 'I', 'like', 'cats')
    FROM users;