top of page
Search

Scalar function COALESCE

  • class928417
  • Aug 12, 2014
  • 1 min read

פונקציה סקלרית COALESCE למי שרוצה להציג מס' אפשרויות הצגה (ללא null) כאשר יש סיכוי שאחד השדות או יותר הוא Null.

להלן דוגמא :

use northwind

go

--- For each customer display the City, Region and fax numer in one column (שרשור)

-- if one or more of the expressions is null then dont display it. if all are null then

-- display "NO INFO"

-- example : customerid: ALFKI will display "Berlin 0.0-0076545"

select

customerid, CompanyName , city , region , fax

,COALESCE(city+' '+region+' '+fax ,city+' '+fax ,city+' '+region

,region+' '+fax ,city ,region ,fax, 'No info') as NewInfo

from Customers


 
 
 

Recent Posts

See All
Project MDX

נוספו MDX עבור הפרויקט למי שמתקשה. נמצא בלשונית "project" שאול

 
 
 
דוגמאות משלבי הפרויקט

הי, הוספתי בחלק של הפרויקט באתר מספר דוגמאות לתהליכים שונים משלב ה MRR וה - STG. אעדכן תוך כדי התקדמות הפרויקט. במידה ויש משהו שאתם...

 
 
 
קבוצת פייסבוק חדשה לקורס

המרצה במודול החדש ( מודול הפרויקט) פתח קבוצת פייסבוק לכיתה שלנו. הנה הלינק : https://www.facebook.com/groups/JBH9284.17/ שם הקבוצה :...

 
 
 

Commentaires


bottom of page