Return unique value but include blank as well

  • I realize this is probably a silly question but I've seen it done before and it was rather straight forward and simple but for the life of me I can't remember how to do it and can't seem to find an example so I thought I'd post it here.

    What I am trying to do is get a distinct result set and have a blank item added as well.

    As an example if I were running this select statement I would want all of the states to be returned as well as a blank value. The blank value is not contained in the data.

    SELECT DISTINCT state

    FROM gl_territory

  • select '' UNION

    SELECT DISTINCT state

    FROM gl_territory

  • That's it! Thanks for the help while I had a momentary brain fart.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply