[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

Force a Null

I want to force a value in a select statement to be null.

if some column has has anything it, return as a null.
0
asullivan62
Asked:
asullivan62
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:
That's something of a contradiction.  If a column contains data, return null.  Otherwise return null???

You can always select NULL as any column in the select statement.

  SELECT name, address, NULL as City FROM sometable


Or did you mean something else?

Kent
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now