I have the following query
Select VehicleTrimAbbreviated, VehicleTrimAbbreviatedId
Where vehicleTrimAbbreviated like 'CX%'
order by VehicleTrimAbbreviated asc
3255;"CXL Premium Sedan"
538;"CXL Sport Utility"
3319;"CXL Turbo Sedan"
1959;"CX Plus Minivan"
535;"CX Sport Utility"
Why would this not sort correctly? All the CX should be first, then
CXL, Then CXS
Here is the table definition:
CREATE TABLE vehicletrimabbreviated
vehicletrimabbreviatedid integer NOT NULL,
vehicletrimabbreviated character varying(64),
ALTER TABLE vehicletrimabbreviated OWNER TO app_user;
-- Index: vehicletrimabbreviated_i00
-- DROP INDEX vehicletrimabbreviated_i00;
CREATE UNIQUE INDEX vehicletrimabbreviated_i00
-- Index: vehicletrimabbreviated_i01
-- DROP INDEX vehicletrimabbreviated_i01;
CREATE INDEX vehicletrimabbreviated_i01
-- Index: vehicletrimabbreviated_i02
-- DROP INDEX vehicletrimabbreviated_i02;
CREATE INDEX vehicletrimabbreviated_i02
-- Index: vehicletrimabbreviated_i03
-- DROP INDEX vehicletrimabbreviated_i03;
CREATE INDEX vehicletrimabbreviated_i03
-- Index: vehicletrimabbreviated_i04
-- DROP INDEX vehicletrimabbreviated_i04;
CREATE INDEX vehicletrimabbreviated_i04
(vehiclebodystylegroupid, vehiclesubmodelid, vehiclebodystyleid);
-- Index: vehicletrimabbreviated_i05
-- DROP INDEX vehicletrimabbreviated_i05;
CREATE INDEX vehicletrimabbreviated_i05
-- Index: vehicletrimabbreviated_i06
-- DROP INDEX vehicletrimabbreviated_i06;
CREATE INDEX vehicletrimabbreviated_i06
Source Interlink Media
1733 Alton Pkwy Suite 100, Irvine, CA 92606
Confidentiality Notice- This electronic communication, and all
information herein, including files attached hereto, is private, and is
the property of the sender. This communication is intended only for the
use of the individual or entity named above. If you are not the intended
recipient, you are hereby notified that any disclosure of; dissemination
of; distribution of; copying of; or, taking any action in reliance upon
this communication, is strictly prohibited. If you have received this
communication in error, please immediately notify us by telephone,
(949)-705-3000, and destroy all copies of this communication. Thank you.
pgsql-sql by date
|Next:||From: Emi Lu||Date: 2011-05-09 19:37:40|
|Subject: Re: Sorting Issue|
|Previous:||From: Tarlika Elisabeth Schmitz||Date: 2011-05-09 12:17:17|
|Subject: Trigger: update if record exists|