Executing an SQL Data Definition Query

  • Thread starter Thread starter James Pannozzi
  • Start date Start date
J

James Pannozzi

I'm trying to sort a database of 146,000
rows by the string length of the row and there is only 1
field in column 1.

The column 1 text is, for example, as follows:

something(whatever,ATACCAA);
something(whateverelse,AAATTT);
something(somethingelse,CGAA;
something(nothing,TTTTTTAACGAAAAA);

I can type a query into the SQL design query box
as follows

SELECT col1
FROM TABLE1
ORDER BY LEN(col1)

After I enter this, instead of sorting the database another box
appears which wants some sort of parameter.
When I enter for example "SortedDatabase" as the parameter,
it takes the word "SortedDatabase" and puts it in all 146,000 rows.

How do I get the database sorted by string length???

Thanks
Jim
 
Hi James,

This will happen if the actual name of the field is something other than
"col1". Find out the proper name (e.g. by opening the table in design
view) and use that in your query.
 
Yep, you figured it exactly.

I was calling it "col1"
but the real name was "Field1".

As soon as I corrected that, it did the sort,
and it did quite quickly too!

Thanks
J
 
Back
Top