Go Back  DVD Talk Forum > General Discussions > Tech Talk
Reload this Page >

how to sort a query with SQL command

Tech Talk Discuss PC Hardware, Software, Internet and Other Technology

how to sort a query with SQL command

Old 12-04-01, 02:15 PM
  #1  
Banned
Thread Starter
 
Join Date: Aug 2001
Posts: 2,322
Likes: 0
Received 0 Likes on 0 Posts
how to sort a query with SQL command

i need to sort PCnames in one of my querys from my database, and the name's look like this:

TalkTech1
TalkTech2
...
TalkTech30





i had this:

PHP Code:
sql="SELECT Distinct * FROM PClist ORDER BY PCnames" 

the problem is, this is doing it correctly based on the command, but its not i want.

this is giving me:

TalkTech1
TalkTech10
TalkTech11
etc etc


I want it to go from TalkTech1--TalkTech30



is there any obvious way to do this?

(maybe i need to make two fields in the table?
Old 12-04-01, 02:17 PM
  #2  
Moderator
 
Groucho's Avatar
 
Join Date: Mar 2000
Location: Salt Lake City, Utah
Posts: 71,383
Received 117 Likes on 79 Posts
You should probably rename the names to be TalkTech01, TalkTech02, etc.
Old 12-04-01, 02:47 PM
  #3  
Banned
Thread Starter
 
Join Date: Aug 2001
Posts: 2,322
Likes: 0
Received 0 Likes on 0 Posts
i know, i thought of that, but it might mislead the person who reads the result as the actual pc name is TALKTECH1 not TALKTECH01.....


oh well, its not that big of a deal. i gave each pcname a unique PCid, i can sort by that for now.

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service - Do Not Sell My Personal Information -

Copyright 2021 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.