ORACLE : How to Calculate Average of Date Values ?

February 25th, 2013, posted in Oracle Queries
Share

Are you getting trouble of calculating average time of a filed, where data type is date time ?
Don’t worry. You are at right place to get right solution.

I’m going to calculate average time of a filed.
If there is two time value in a day, i will calculate the first one means minimum one.

SELECT TO_CHAR(TRUNC(SYSDATE)+AVG(VDATE-TRUNC(VDATE)),’HH24:MI:SS’)
FROM (SELECT MIN(DDATE) VDATE
FROM DEPT
GROUP BY TRUNC(DDATE))

****************************************************************************************************************
Note : Please not do make backups before using these queries and also confirm them yourself or by aother means as
well.
*****************************************************************************************************************
Share

What Happen In Iraq By Usa

February 24th, 2013, posted in Art, COMiCS, UNiVERSE
Share

What Happen In Iraq By Usa,Iraq,usa,united states of america,america,

Share

Green Lantern- Muslim Edition

February 24th, 2013, posted in COMiCS
Share

Green Lantern, Muslim Edition,Green Lantern- Muslim Edition,Green Lantern,Muslim,Islam

Share

C Program Remove Spaces, Blanks From A String

February 23rd, 2013, posted in C
Share

C code to remove spaces or excess blanks from a string, For example consider the string

“c programming”

There are two spaces in this string, so our program will print a string

“c programming”. It will remove spaces when they occur more than one time consecutively in string anywhere.

C programming code :

#include <stdio.h>

int main()
{
   char text[100], blank[100];
   int c = 0, d = 0;

   printf("Enter some textn");
   gets(text);

   while (text[c] != '')
   {
      if (!(text[c] == ' ' && text[c+1] == ' ')) {
        blank[d] = text[c];
        d++;
      }
      c++;
   }

   blank[d] = '';

   printf("Text after removing blanksn%sn", blank);

   return 0;
}

C Programming Code Using Pointers :

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define SPACE ' '

main()
{
   char string[100], *blank, *start;
   int length, c = 0, d = 0;

   printf("Enter a stringn");
   gets(string);

   length = strlen(string);

   blank = string;

   start = (char*)malloc(length+1);

   if ( start == NULL )
      exit(EXIT_FAILURE);

   while(*(blank+c))
   {
      if ( *(blank+c) == SPACE && *(blank+c+1) == SPACE )
      {}
      else
      {
         *(start+d) = *(blank+c);
	 d++;
      }
      c++;
   }
   *(start+d)='';

   printf("%sn", start);

   free(start);     

   return 0;
}

Compiler used:

GCC

Output of program:

get blanks in c program



Share

Josh Malihabadi

February 22nd, 2013, posted in DAtEs iN a YeAR, PAKiSTAN, POEPLes
Share

josh,urdu literature,urdu,poetry,india,22 feb,pakistan,paki,Padma Bhushan,Malihabad,Lucknow, Shabbir Hasan Khan,poet,Doyen of the Progressive Writers’ Movement, Josh Malihabadi dominated the Urdu literary scene of the 20th century Indian sub-continent. Born on December 5, 1898 as Shabbir Hasan Khan in Malihabad, near Lucknow he studied at St Peter’s College, Agra and passed his Senior Cambridge examination in 1914. Josh subsequently studied Arabic and Persian and, in 1918, spent six months at Tagore’s university at Shantiniketan.

While working as in charge of the translation department of Jamia Osamania, Hyderabad, Josh wrote a poem against the oppressive Nizam and was exiled from the state. Josh then worked for Shalimar Film Company in Poona as songwriter for about four years.

Josh was known as “Shair-e-Inqilab”. He also got actively involved in the freedom struggle and became close to quite a few of the political leaders of that era, specially Jawahar Lal Nehru. His first collection of poems was published under the title of Rooh-e-Adab. The collections of his poetry include Shola-o-Shabnam, Junoon-o-Hikmat, Naqsh-o-Nigar, Fikr-o-Nishaat, Sunbal-o-Salaasal, Harf-o-Hikaayat and Sarod-o-Kharosh. Josh was editor of Aaj Kal and advisor to the All India Radio. He was honoured with the Padma Bhushan in 1954 by the President of India.

Josh was concerned with the state of Urdu in independent India and migrated to Pakistan in 1956, but was not well-received by the authorities and pro-establishment media of Pakistan for his iconoclastic ideas and socialistic leanings. His autobiography Yadon Ki Barat was published in 1966. He died on February 22, 1982.

http://www.tumblr.com/tagged/josh%20malihabadihttp://www.tumblr.com/tagged/josh%20malihabadijosh,urdu literature,urdu,poetry,india,22 feb,pakistan,paki,Padma Bhushan,Malihabad,Lucknow, Shabbir Hasan Khan,Inssan ko bedaar tou ho ly ny doujosh,urdu literature,urdu,poetry,india,22 feb,pakistan,paki,Padma Bhushan,Malihabad,Lucknow, Shabbir Hasan Khan,Inssan ko bedaar tou ho ly ny dou

Share