Monday, December 9, 2013

Pivot without aggregate function in oracle

Hey guys today im gonna show how to Pivot without using aggregate function in oracle 11G.

You can create the following table or just look at it for getting an idea!

CREATE TABLE PIVOT_TEST (  STORE_BRANCH VARCHAR2(50),
SALES_TYPE VARCHAR2(50),
SALES NUMBER
);

INSERT INTO PIVOT_TEST VALUES('BRANCH 1','BOOKS',1230);
INSERT INTO PIVOT_TEST VALUES('BRANCH 1','GROCERY',990);
INSERT INTO PIVOT_TEST VALUES('BRANCH 1','DIGITAL',1930);
INSERT INTO PIVOT_TEST VALUES('BRANCH 2','BOOKS',12301);
INSERT INTO PIVOT_TEST VALUES('BRANCH 2','GROCERY',34990);
INSERT INTO PIVOT_TEST VALUES('BRANCH 2','DIGITAL',14930);
INSERT INTO PIVOT_TEST VALUES('BRANCH 3','BOOKS',59);
INSERT INTO PIVOT_TEST VALUES('BRANCH 3','GROCERY',21);
INSERT INTO PIVOT_TEST VALUES('BRANCH 3','DIGITAL',67);
INSERT INTO PIVOT_TEST VALUES('BRANCH 4','BOOKS',34);
INSERT INTO PIVOT_TEST VALUES('BRANCH 4','GROCERY',2323);
INSERT INTO PIVOT_TEST VALUES('BRANCH 4','DIGITAL',666);

SELECT * FROM PIVOT_TEST;

So now for every branch there are different sales types, now what if you need to pivot them in order to get details of each branch in a single row? Obviously if we need to go by the Orcale Pivot inbuilt function.. Aggregate function is must, now i m gonna show a different approach for solving this problem :)

STORE_BRANCH SALES_TYPE SALES

BRANCH 1 BOOKS 1230
BRANCH 1 GROCERY 990
BRANCH 1 DIGITAL 1930
BRANCH 2 BOOKS 12301
BRANCH 2 GROCERY 34990
BRANCH 2 DIGITAL 14930
BRANCH 3 BOOKS 59
BRANCH 3 GROCERY 21
BRANCH 3 DIGITAL 67
BRANCH 4 BOOKS 34
BRANCH 4 GROCERY 2323
BRANCH 4 DIGITAL 666

Firstly you need to LISTAGG the SALES_TYPE for every branch .

SELECT 
    STORE_BRANCH,
    LISTAGG(SALES, ', ') WITHIN GROUP (ORDER BY SALES_TYPE) "SALES"
FROM PIVOT_TEST 
GROUP BY STORE_BRANCH;

STORE_BRANCH  SALES

BRANCH 1 1230, 1930, 990
BRANCH 2 12301, 14930, 34990
BRANCH 3 59, 67, 21
BRANCH 4 34, 666, 2323

Now the above LISTAGG query goes in to the below query as a INLINE SUBQUERY.

Based on the comma position we split the strings using REGEXP_SUBSTR into each column.

SELECT 
        STORE_BRANCH,
        REGEXP_SUBSTR(SALES,'[^,]+',1,  1)   BOOKS,
        REGEXP_SUBSTR(SALES,'[^,]+',1,  2)   DIGITAL,
        REGEXP_SUBSTR(SALES,'[^,]+',1,  3)   GROCERY
FROM
(
SELECT 
STORE_BRANCH,
LISTAGG(SALES, ', ') WITHIN GROUP (ORDER BY SALES_TYPE) "SALES"
FROM PIVOT_TEST 
GROUP BY STORE_BRANCH
);

Viola now we have successfully pivoted !!

STORE_BRANCH BOOKS DIGITAL GROCERY

BRANCH 1 1230   1930   990
BRANCH 2 12301   14930   34990
BRANCH 3 59   67   21
BRANCH 4 34   666   2323

For any queries feel free to comment !

If you liked the Post Feel Free to Share this!! http://dkartheek.com

Tuesday, March 5, 2013

Sony confirms Xperia Z India launch date on March 6


In line with what we reported last month, it's now confirmed that Sony will be making a major announcement related to its flagship smartphone, the Xperia Z, on 6 March 2013. The company has updated its Facebook cover picture teasing the Xperia Z with the 06/03/13 date in bold and an 'Everything is about to change' tagline. A Sony spokesperson also confirmed that the phone is indeed launching on 6 March.

At the time of writing this post, the page also posted another picture that with a hazy side profile image of the phone along with a '2 Days to go' teaser text. The update links to a page which has a countdown timer and the Twitter hashtag #bestofSony.

Sony had announced its latest flagship smartphones Sony Xpera Z and Xperia ZL at Consumer Electronics Show (CES) 2013. Just to recap, Sony Xperia Z smartphone comes with a 5-inch LCD TFT touchscreen Reality display with a resolution of 1920x1080 pixels. Sony has also integrated the Mobile Bravia Engine 2 to the display to make pictures more brighter and sharper. The other specifications include 1.5GHz Snapdragon S4 Pro quad-core processor with 2GB of RAM, 16GB internal storage, which can be expanded by up to 32GB via microSD card. The smartphone also comes with 13-megapixel rear camera and runs on Android 4.1 (Jelly Bean). The Xperia Z is IP55 and IP57 certified, which means it is dust and water resistant.

Sony Xperia ZL is a design variant of the Xperia Z, sporting similar specifications in a smaller form factor. It's not clear if Sony would also launch the Xperia ZL on the same day.

Sony Xperia Z specifications
  • 5-inch full-HD display
  • 1.5 GHz Snapdragon S4 Pro quad-core processor
  • 2GB RAM
  • 13-megapixel rear camera
  • 16GB internal storage (expandable by 32GB)
  • Bluetooth 4.0, NFC, Wi-Fi
  • Android 4.1 for more detailed specs click here :)

Please comment and If you liked the Post Feel Free to Share this!! http://dkartheek.com

Friday, January 18, 2013

Top 10 Megan Nicole Songs


This is the compilation of Top 10 megan nicole songs ... 
You can even recommend other songs for this list down in the comments section :) Enjoy !!



Please comment and If you liked the Post Feel Free to Share this!! http://dkartheek.com

Sony Xperia Z Specs,Price in India


  • Dimensions: 5.47" x 2.79" x 0.31"
  • Weight: 146g / 5.15oz
  • Color options: Black, purple and white
  • Android 4.1
  • Display: 5-inch, 1920x1080 pixels, 16,777,216 color TFT
  • Sony Mobile BRAVIA Engine 2
  • Scratch-resistant, shatter proof sheet on mineral glass
  • 1.5 GHz Qualcomm APQ8064+MDM9215M Quad Core
  • Qualcomm Adreno 320 GPU
  • 2GB RAM
  • IPX5/7 (Water-resistant) & IP5X (Dust-proof)
  • Front Camera: 2MP (1080p video)
  • Rear Camera: 13.1MP (1080p video) w/ LED flash, AF
  • 16x digital zoom
  • Internal storage: 16GB
  • MicroSD slot: Up to 32GB
  • 3.5mm audio port
  • MicroUSB and MHL ports
  • Battery: 2330mAh (non-removable)
  • Bluetooth 4.0
  • NFC support
  • GSM, LTE, Wi-Fi, GPS
Xperia Z Price in India :

The Most anticipated smart phone has been put for pre-order on a UK based online retailer, EXPANSYS for $714.99 which roughly maps to 38,000 INR . So the price might be around 40k in india .



Please comment and If you liked the Post Feel Free to Share this!! http://dkartheek.com

Thursday, January 17, 2013

New telugu Short Film- Ardham Kaani prema Teaser


ArDhAm K@@Ni PrEmA Trailer



ArDhAm K@@Ni PrEmA Music trailer



::::::::::::::::::::ArDhAm KaNi PrEmA:::::::::::::::::

Produced by TARUN DUVVURU,SRAVANSAROSH K,HIMA SANDEEP
Music Composed by ZENY KODURU
Lyrics by RAJY & RAMY AKULA
Songs Sung by RAJY AKULA,RAMY AKULA,SAI KIRAN P
Casting by HIMA SANDEEP A 
Locations by SRAVANSAROSH K
Costumes & Styling by CHANDINI NAIR
Editing and VFX by PRATYUSH PARUCHURI
Cinematography by SRAVANSAROSH K and HIMA SANDEEP 
Written & Directed By SRAVANSAROSH KODURI


The Completed short film will be uploaded soon on Youtube ... 

Check this spot for further updates :D

Please comment and If you liked the Post Feel Free to Share this!! http://dkartheek.com

Thursday, October 18, 2012

Cameraman Ganga tho rambabu Exclusive Movie Review



Producer: D. V. V. Danayya

Story/ Screenplay / Direction : Puri Jagannath

Starring: Pawan Kalyan, Tamannaah, Prakash Raj, Gabriela Bertante, Brahmanandam, Ali, Tanikella Bharani, Kota Srinivasa Rao, Dharmavarapu Subramanyam, Scarlett Mellish Wilson

Music: Mani Sharma

Cinematography: Shyam K. Naidu

Editing: S. R. Shekhar

Rating: 3/5

After little hiccups ‘Cameraman Ganga Tho Rambabu’ released all over world with huge expectations as it is releasing after the biggest hit ‘Gabbar Singh’. Director Puri Jagannath finished the movie on fast track is confident that the movie will reach ‘Gabbar Singh’ in records. Let us see how far he is true…

Story:

Mechanic Rambabu (Pawan Kalyan) helps the needy people in the society. In simple he is a People Person. Jawahar Naidu( Kota), EX Chief Minister conspires to topple the Chandrasekhar Reddy(Nasser) government. He sketches a plan to create a fight between two different caste groups which was ultimately foiled by Rambabu and garners media attention. Ganga (Tamannah) who works as a cameraman in a news channel recommends Ramababu for the reporter post. Mechanic Rambabu becomes Reporter Ramababu.

Dasharathram (Surya), a senior journalist gets killed by Rana Naidu(Prakash Raj), son of Jawahar Naidu for unearthing their scams. When law and order turn blind on the murder, Rambabu in a capacity of reporter make sure Rana gets arrested for the murder. Rana releases from the jail by manipulating the case and challenges Rambabu that one day he will become CM with the support of the media.

Rest of the story is how Rambabu stopped criminal Rana Naidu from becoming the Chief Minister.

Performance:

Pawan Kalyan looked handsome with weight gain.Pawan Kalyan has given a splendid performance as Rambabu. You can see fire in his eyes when acting in emotional scenes or appealing to public. His comedy timing, dances and fights are good.

Tamannah is rapidly raising the graph in terms of performance and glamor. Her glamor is eye feast to audience. Foreign actors Scarlet Wilson and Gabriela Bertante added glamor to the movie.

Prakash Raj is at his usual best as antagonist.  Kota, Tanikella Bharani, Nasser, MS Narayan did their best.

Ali as SRK and Brahmanandam as Bobby evoked laughs in few scenes. Dharmavaram, Uttej acted in small roles.

Direction & Technical:

Puri Jagannath dusted off an old script and made few changes inspiring from the current political scenario in Andhra Pradesh and made ‘Cameraman Ganga Tho Rambabu’. His direction is good, but the screenplay is under par.

The tempo of the movie takes a roller-coaster ride. The movie starts off slowly and picks up tempo towards interval and slides down before picking towards climax. His dialogue writing skills are surely appreciable.

Manisharma Music is good and background score should have been better.

Cinematography by Shyam K Naidu is top notch. Dinesh choreography is good.

Editing should have been better and can be trimmed at least 10 min. You get to see action scenes without using any jump ropes.

Review from AndhraHeadlines.com

Please comment and If you liked the Post Feel Free to Share this!! http://dkartheek.com

Wednesday, October 17, 2012

Cameraman Ganga tho Rambabu Live updates


  1. Titles Started with a background of politicians from Gandhi – KCR period
  2. Good Response for the CBN,ys jaagn,Chiranjeevi Visuals …
  3. Pawan kalyan Enter in Orange…Dress
  4. Pawan show interest in common peoples problems..
  5. Tamanna insearch of Pawan….
  6. Ganga joins pawan in the Tv Channel she is working for…
  7. Jormochindi song started.
  8. Pawankalyan Steps in Joramochindi song are nice.
  9. Ali entered.Same channe lo working...Pawankalyan ki senior.
  10. Pk interviewing lady politician... 
  11. Time pass comedy by Pawan and Ali.
  12. Comedy scene between ganga and rambabu is nice...
  13. Prakash raj entered as Villian..
  14. First fight..okamanchi manishi ni champinanduku PK prakash raj ni kotti teesukeltadu.
  15. Kota son Praksh raj
  16. Kota tho Pawankalyan dailogue..."nuvvu cm ni kalisi vundochu pm ni kalisi vundochu kaani naalanti tikka naa kodukuni kalisi vundav" 
  17. Second song extraordinary..
  18. Extraordinary song is very ordinary...pk has to change his dancing style is gettin repeated, and as usual Tammanah shows her navel.
  19. Pawankalyan to prakash raj dialogue...."nuvvu 10 mandi 20 mandi 120 mandi enta mandini techina nannu round up chesedi nalugure...tees uku raara enta mandini testavoo"
  20. Another Dialogue "Media ni vunchukodaniki vuyyala vuugadaniki…media evariki umpudugatte kaadu."
  21. Second fight started.. interval appudu prakash raj serious ga rowdys ni teesuku vachadu.Fight Over.
Entrance scene :D



According to reports , 

 First half of the movies goes like how Pawan Kalyan joined media and how Tamanna finds kalayan and what is the main reason to join in media. Ali plays a TV channel manager. CGR is good with less punch dialogue and Tammanah was superb acting before going to interval. In First half altogether 3 fights and Second fight superb. Comedy between Thammana and pawan was good.

Dialogues by Prakash raaj about Politics keka
Pawan Attitude keka Movie lo

Tamanna pawan chemistry sampesindiiiiii

 Some Dialouges: (Updates from Different Sources)



"Naalaantii thikkaanaakoduku ni kalisi undav pk to kotaaa kekaaa"
 “SC,ST,BC students oke school lo chaduvutunte ,hostels matram separate ga enduku untayo naku teliyali”-Pawan Kalyan 


  • Please refresh the page every 5-10 Mins to see the updates.
  • Stay tuned for further updates from anonymous sources....

  • Please comment and If you liked the Post Feel Free to Share this!! http://dkartheek.com

Thursday, September 20, 2012

Install Cygwin and Gedit for Unix like environment on windows


Installing Cygwin/X

Cygwin tools are, in the words of the Cygwin development homepage, http://cygwin.com/"ports of the popular GNU development tools and utilities for Windows 95, 98, and NT. They function by using the Cygwin library which provides a UNIX-like API on top of the Win32 API." Cygwin allows the compilation of the X Window System source on Win32; several patches were made to the X Window System source to make it actually compile and run under Cygwin.
Cygwin has a nice setup program that downloads and installs the necessary Cygwin packages for you.
  1. Open the Cygwin, http://cygwin.com/ page in your web browser
  2. Click the  "Install Cygwin Now" link in the upper-right hand corner of the page. This link downloads setup.exe from the primary Cygwin server; save setup.exe to the directory that you would like to store the downloaded packages in (e.g. c:\download); do not save setup.exe to c:\cygwin, as that is the default directory for the extraction and installation of the downloaded packages.
  3. Run setup.exe, you will see the welcome screen:
  4. Click Next to proceed to the next screen.
  5. Choose, Install from Internet, this will still save the package files to your download directory so that you can install Cygwin on any number of machines:
  6. Click Next to proceed to the next screen.
  7. The default Install Root is c:\cygwin which should be fine for most installations. Leave Default Text File Type as UNIX. Leave Install For set to All unless you lack local administrative privileges.
  8. Click Next to proceed to the next screen.
  9. Local Package Directory should default to the directory that you ran setup.exe from:
  10. Click Next to proceed to the next screen.
  11. Choose your proxy setup, or, just choose Direct Connection if no proxy is needed:
  12. Click Next to proceed to the next screen.
  13. Select your nearest mirror for downloading:
  14. Click Next to proceed to the next screen; setup will download a list of available packages as it moves to the next screen.
  15. On the next screen you will select the packages that will be downloaded and installed. A listing of the Cygwin/X packages is given below; a listing of the general Cygwin packages would be beyond the scope of this document.
    Cygwin/X packages are located in the X11 category.
    • xorg-server (required, the Cygwin/X X Server)
    • xinit (required, scripts for starting the X server: xinitstartxstartwin (and a shortcut on the Start Menu to run it), startxdmcp.bat )
    • xorg-docs (optional, man pages)
    • X-start-menu-icons (optional, adds icons for X Clients to the Start menu)
    • You may also select any X client programs you want to use, and any fonts you would like to have available.
    • You may also want to ensure that the inetutils or openssh packages are selected if you wish to use telnet or ssh connections to run remote X clients.
  16. Click Next to begin the download process, you may want to try another mirror if you see a "Connecting" message on this screen for a long period of time:
  17. After the packages are downloaded, setup will automatically begin to install them:
  18. I highly recommend allowing Cygwin Setup to create Desktop and Start Menu icons for you; these icons simply launch a bash shell:
  19. Click Finish to close the setup program.

    ........... After successfully installing Cygwin, you need to install Gedit for windows in order to compile and execute your code via cygwin terminal.

    Gedit helps you to save files in unix compliant format so that you wont end up getting unlikely errors as windows formats and unix formats are completely different !

    Here's the Link for Gedit :) Gedit is just an Unix Editor.(After typing the code be sure to save the code in unix format :D


    http://ftp.gnome.org/pub/gnome/binaries/win32/gedit/2.30/

Please comment and If you liked the Post Feel Free to Share this!! http://dkartheek.com

Total Pageviews

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More