Teradata case statement Chalanachithram.com | Topics | Search
Hide Clipart | Log Out | Register | Edit Profile

Last 30 mins | 1 | 2 | 4 hours     Last 1 | 7 Days

Chalanachithram.com DB » TF Industry related » Archive through November 03, 2012 » Teradata case statement « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Goonda
Megastar
Username: Goonda

Post Number: 22012
Registered: 02-2007
Posted From: 75.66.158.123

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 08:11 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Ruj:


You can also use COALESCE for more than 2 values

COALESCE(Col1,Col2,col3, 0) returns first column that is not null.

(Message edited by admin on November 03, 2012)
Sasibabu: If TDP loses next elechens, i will donate 10% of my salary to TDP

Skywalker: Bala chiru type kadu.....narasimha swamy avataram etti posani gadi pegulu medalo esukuntadu
Top of pagePrevious messageNext messageBottom of page Link to this message

Ruj
Side Hero
Username: Ruj

Post Number: 7822
Registered: 03-2007
Posted From: 76.113.251.241

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 08:08 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Goonda:


why can't you use function COALESCE

COALESCE(Col1,0) = return col1 if not NULL, 0 if NULL.




perfect..will try..thanks..
Visalandhra book house, koti - one stop place for all telugu literature..(books,novels, literature etc)..
Top of pagePrevious messageNext messageBottom of page Link to this message

Goonda
Megastar
Username: Goonda

Post Number: 22011
Registered: 02-2007
Posted From: 75.66.158.123

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 08:04 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Ruj:




why can't you use function COALESCE

COALESCE(Col1,0) = return col1 if not NULL, 0 if NULL.
Sasibabu: If TDP loses next elechens, i will donate 10% of my salary to TDP

Skywalker: Bala chiru type kadu.....narasimha swamy avataram etti posani gadi pegulu medalo esukuntadu
Top of pagePrevious messageNext messageBottom of page Link to this message

Goonda
Megastar
Username: Goonda

Post Number: 22010
Registered: 02-2007
Posted From: 75.66.158.123

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 08:03 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Ruj:




why can you use function COALESCE

COALESCE(Col1,0) = return col1 if not NULL, 0 if NULL.
Sasibabu: If TDP loses next elechens, i will donate 10% of my salary to TDP

Skywalker: Bala chiru type kadu.....narasimha swamy avataram etti posani gadi pegulu medalo esukuntadu
Top of pagePrevious messageNext messageBottom of page Link to this message

Ruj
Side Hero
Username: Ruj

Post Number: 7820
Registered: 03-2007
Posted From: 76.113.251.241

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 07:43 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Emc2:

target ki chesthunnava?



nope
Visalandhra book house, koti - one stop place for all telugu literature..(books,novels, literature etc)..
Top of pagePrevious messageNext messageBottom of page Link to this message

Ruj
Side Hero
Username: Ruj

Post Number: 7819
Registered: 03-2007
Posted From: 76.113.251.241

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 07:43 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Goonda:

nee requirement enti?




requirement ante peddha em ledu bhayya..actually its reporting side..replacing nulls with zeroes..alage showing values only for some specific flags..ala anamaata..

so using many case statements..

like case when A= 'Pass' then [Amount] else 0..ala...

pt is..in oracle we used to use decode statements..as case adversly effects the performance..

ippudu pointing to teradata...so aa decode fn work avvatledu..so teradata lo emayina specific fns unnaya case ki alternative ga ani..

Visalandhra book house, koti - one stop place for all telugu literature..(books,novels, literature etc)..
Top of pagePrevious messageNext messageBottom of page Link to this message

Emc2
Side Hero
Username: Emc2

Post Number: 9251
Registered: 03-2008
Posted From: 71.246.229.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 07:00 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Ruj:




target ki chesthunnava?
cherapakura chedevu.
Top of pagePrevious messageNext messageBottom of page Link to this message

Outlaw
Comedian
Username: Outlaw

Post Number: 1644
Registered: 02-2012
Posted From: 198.228.228.176

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 06:56 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

Cast?
Top of pagePrevious messageNext messageBottom of page Link to this message

Goonda
Megastar
Username: Goonda

Post Number: 22009
Registered: 02-2007
Posted From: 75.66.158.123

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 06:53 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

nee requirement enti?
Sasibabu: If TDP loses next elechens, i will donate 10% of my salary to TDP

Skywalker: Bala chiru type kadu.....narasimha swamy avataram etti posani gadi pegulu medalo esukuntadu
Top of pagePrevious messageNext messageBottom of page Link to this message

Ruj
Side Hero
Username: Ruj

Post Number: 7818
Registered: 03-2007
Posted From: 76.113.251.241

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, November 03, 2012 - 06:38 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

kakunda inkemayina use cheyacha oracle lo decode laga..better performance ki..
Visalandhra book house, koti - one stop place for all telugu literature..(books,novels, literature etc)..

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image HASH(0x86dbd44){Movie Clipart}
Show / hide regular icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Show / Hide Filmy icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: