sql null's
hi there,
im writing a query which produces a lot of null's on a test mysql db ive got going. i was just wondering (for learning purposes) how you replace the blank null spaces with a word like null or any other word for that matter?
im writing a query which produces a lot of null's on a test mysql db ive got going. i was just wondering (for learning purposes) how you replace the blank null spaces with a word like null or any other word for that matter?
Xbox Live: Bring It On
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking
Comments
Forum Admin at www.techexams.net
--
LinkedIn: www.linkedin.com/in/jamesdmurray
Twitter: www.twitter.com/jdmurray
Example:
Select FirstName, LastName, (COALESCE(MiddleName, "No Middle Name")
FROM Employee
In this example, COALESCE takes the first argument, "MiddleName", and outputs that value. If there is no value (aka NULL), it outputs the second argument "No Middle Name".
Does coalesce work on all dbms's?
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking
You can try using ISNULL in a case statement as an alternative.
Forum Admin at www.techexams.net
--
LinkedIn: www.linkedin.com/in/jamesdmurray
Twitter: www.twitter.com/jdmurray
UPDATE Customers SET Address = 'textstring" where Address is NULL
Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
Working on: RHCE/Ansible
Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands...