Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> sql help

sql help

From: Joan <tylin_at_mediaone.net>
Date: Wed, 10 Jan 2001 00:13:53 +0000
Message-Id: <10736.126216@fatcity.com>


Dear listers,
I need some sql help, I changed a new job recently from cozy school environment to a startup company. Am I crazy? Yes. Anyway, I've been here just 4 days, the boss give me this assignment. I am stuck.

Here is the entries table. If I select ent_url, ent_http_headers from entries; I will get the following rows back. (Millions rows) First line is ent_url, the others are ent_http_headers

http://www.cartoonnetwork.com:80/legal/img/boomerang.click.gif Server: Netscape-Enterprise/2.01
Expires: Tue, 09 Jan 2001 19:47:10 GMT
Accept-ranges: bytes
Last-modified: Fri, 15 Dec 2000 22:50:40 GMT Content-type: image/gif

http://www.coedsexxx.com:80/tgp/posing/body/013.jpg Server: Apache/1.3.12 (Unix)
Last-Modified: Sat, 12 Aug 2000 12:26:03 GMT ETag: "5330-478a-3995425b"
Accept-Ranges: bytes
Content-Type: image/jpeg

http://www.worldwide-wives.com:80/members/2000-05/day15/images/Bab'sAsleep01

.jpg
Server: Apache/1.3.9 (Unix) PHP/3.0.12
Last-Modified: Mon, 12 Jun 2000 12:01:07 GMT ETag: "9737f-2fa6-3944d103"
Accept-Ranges: bytes
Content-Type: image/jpeg

Now I need a output like this;

content-type url-extention total count % of total count

image                       jpg
                                jpeg
                                gif
                                html
text                          html
                                plain
application
audio                        basic

so far, I just can manage parsing the string . No doing any % cal. yet. Still, this is not right.
select
lower((substr(ent_http_headers,instr(ent_http_headers,'Content-Type:',-1,1),

25))) "col1" ,
 lower(substr(ent_url,instr(ent_url,'.',-1,1),4)) "col2" from entries where rownum <3

col1                      col2
------------------------- ----

.jpgnt-type: image/jpeg
.jpgnt-type: image/jpeg

I expect to get
content-type: .jpeg
I'd appreciate it very much if someone could help me with the whole Received on Tue Jan 09 2001 - 18:13:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US