Adding Records at Start

Cindy Brown cindy at kowhaiprogramming.com
Thu Jan 8 08:31:54 CST 2004


Hi Mark,

Is your ID field a string or a number? If it is sorted as you write then it
is sorting in alpha order which will sort all records beginning with 1
(including 10, 11, etc.), then 2. To get it to sort in numerical order the
field needs to be set as short or another numerical field.

Hope that helps.

Cindy

> Can someone explain why my SQL query is not working properly?
> 
> SELECT DISTINCT level_1 FROM resources ORDER BY ID
> should result in a unique list sorted by ID number. Instead I get a list of
> everything in a strange order -
> 
> ["Screenshots Library", "Offline Materials - PDFs", "Websites",
> "PowerPoints", "Videos", "Screenshots Library", "Screenshots Library",
> "Screenshots Library", "Screenshots Library", "Screenshots Library",
> "Screenshots Library", "Screenshots Library", "Pictures Library"]
> 
> which when looked at by ID number is
> [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9]
> 
> Personally, I've always thought that 2 came before 10 but I might have been
> mistaken.
> 
> Any idea what I'm doing wrong?
> 
> - M
> 
> 
> 
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> 
> Mark D. Maslowski
> Partner/Designer/Programmer
> 
> MAJICo - The Mark and June Interactive Company
> Serving Northern California - from Napa to Monterey!
> www.majico.com
> 
> 831-336-3343 voice       831-336-3353 fax
> 
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 
> 


-- 

Cindy Brown
Programmer
SchoolMaster

Kowhai Programming Systems
PO Box 198, Invercargill
81 Marama Avenue South, 9RD Invercargill
Phone (03) 213 1243
Fax (03) 213 1248
Mobile (021) 354 930
<http://www.kowhaiprogramming.com/>




More information about the Valentina mailing list