Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Mapping NULL values onto other values

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 207
    Comment on it

    In database, sometimes we have to insert the record with some NULL values. But at the time of displaying the data to the user, it doesn't make sense to display NULL values. In order to make the data more readable, we have to display values such as unknown, missing or not available (N/A) instead of NULL values. In MySQL, we use a function IF(). Syntax of IF() function is as follows:

    IF(exp,exp_result1,exp_result2)
    

    If the 'exp' returns TRUE, the IF function returns the value of the exp_result1 otherwise it returns the value of exp_result2.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: