question

Ranju78 avatar image
Ranju78 asked

How to get consolidated Description-2?

This Question is related to the previous question: What if the IDs' are in '947C623E-906A-E511-8C8E-0050569E5B20' format. The cast into int does not work. i have different scenario in same table in sql server and i need to get all the description in active column. Status =0 is active. i have table like this: ID MasterID description Merged Status ------ -------- -------------------- ------ ------ 947C623E-906A-E511-8C8E-0012541 NULL Afrs, gtre 0 0 2572514M-906A-E511-8C8E-0057458 947C623E-906A-E511-8C8E-0012541 Kiuhnj-poiu 1 2 5242514M-906A-E511-8C8E-0057458 947C623E-906A-E511-8C8E-0012541 Hgt-uyr-njhg 1 2 7541514M-906A-E511-8C8E-0057458 NULL lokj-mknh,mnjt 0 0 T451514M-906A-E511-8C8E-0057458 7541514M-906A-E511-8C8E-0057458 vbgfd,hytre 1 2 M142514M-906A-E511-8C8E-0042301 T451514M-906A-E511-8C8E-0057458 null 1 2 83142514M-906A-E511-8C8E-0032651 M142514M-906A-E511-8C8E-0042301 drfs-mjnb-nbhg 1 2 K142514M-906A3-E511-8JGF-0074980 NULL NULL 0 0 GO42514M-906A3-E511-8JGF-006320 K142514M-906A3-E511-8JGF-0074980 bhgyt-kmnj 1 2 DB2514M-906A3-4511-8JGF-0074140 K142514M-906A3-E511-8JGF-0074980 mkrew-ytre,nhbv98 1 2 FG7514M-906A3-4511-8MGF-0074230 DB2514M-906A3-4511-8JGF-0074140 dse4r,ki98m,mkjhy-lk 1 2
sql-server
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Oleg avatar image Oleg commented ·
@Ranju78 This question is identical to the [question you asked before][1], there is no need to duplicate it. Of course ***cast as int*** does not work, why would it? Just replace all occurrences of ***AS INT*** to ***AS UNIQUEUDENTIFIER*** and that is it. It would be nice if you could please shed some light on whether any of the answers (@ThomasRushton ♦♦ or mine) to the previous question work for you. You posted a comment reading "Thank you so much" under @ThomasRushton ♦♦ answer which probably means that you believe that my answer does not work. If if does not then please let me know why. I tested the script before posting, it certainly produces desired output, so I am not sure what is wrong with my answer. Please let me know. Thank you. [1]: https://ask.sqlservercentral.com/questions/145694/how-to-get-consolidated-description.html
1 Like 1 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.