Sorting information using query analyser

From: Chris Scott (chris.scott_at_metalminds.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 08:43:02 -0700

Hi all,

I am trying to sort a really large file of information
and I need some help as I cant work out how to get some
of it.
the fields I have are:
csbytes
cscookie
csuriquery
I need to program to get:
A list of the distinct values in cs bytes ( got have done
this one using: SELECT DISTINCT (csbytes) FROM
*filename*). However the list doesnt work properly as
when i use ORDER BY I get 0, 10000, 1001, etc so if
anyone knows how to order by the length of the field and
then in ascending order that would be REALLY useful.

A count for the number of times each of these distinct
values appear in the csbytes list.

A list of the first 100 longest values in cscookie.

A lost of the first 100 longest values in csuriquery.

I also need to be able to compare cscookie and csuriquery
with a list of characters and find out if any of them
have characters that are not in the list I have, and to
display a boolean false if that is the case.
If anyone can help me on any of these I would really
appreciate it as I am totally stuck and can't find what I
need online or in the SQL book I have.

Many thanks,

Chris