sql - How to make a query to find this? -


मेरे पास तालिका में इस तरह एक डेटा है:

  column1 column2 a 1 a 2 B 2 b 3 a 4 c 5   

मुझे इस तरह एक आउटपुट चाहिए:

  column1 column2 a 1-2 b 2-3 a 4-0 सी 5-0    

इस क्वेरी की कोशिश करें:

  के रूप में vw1 के साथ (तालिका 1 का चयन करें, तालिका 1 से rownum आरएन), vw2 के रूप में (v1 का चयन करें col1, col2, rn, rn - col2 dis), vw3 के रूप में (col1, min (rn), to_char (min (col2 )) जब 'min (col2) = अधिकतम (col2) फिर' 0 'और to_char (अधिकतम (col2)) कॉल 2 द्वारा vw2 समूह से col2, dis आदेश द्वारा min (rn)) col1 का चयन करें , Vw3 से col2;   



Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -