473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

shorting problem in query

i have a problem in a query like


select field1, field2
from table1
order by field1 field1 contains countries (varchar2)


the problem is that order by not shorting right , although i triyed everything..

what could be the problem ? and is there any solutions?
May 22 '08 #1
3 1391
deepuv04
227 Expert 100+
i have a problem in a query like


select field1, field2
from table1
order by field1 field1 contains countries (varchar2)


the problem is that order by not shorting right , although i triyed everything..

what could be the problem ? and is there any solutions?
hi,
if you want to get values in some order then simply use the following query
select field1, field2 from table1 order by field1

if you want to get the values on some condition use where clause
select field1, field2 from table1 where your_condition order by field1

for more details on "Contains" visit the following link, where you can see some examples

http://msdn.microsoft.com/en-us/library/ms187787.aspx
May 22 '08 #2
ck9663
2,878 Expert 2GB
i have a problem in a query like


select field1, field2
from table1
order by field1 field1 contains countries (varchar2)


the problem is that order by not shorting right , although i triyed everything..

what could be the problem ? and is there any solutions?
Could you post some sample data on your table1 and how you would want it sorted? Since your countries are just varchar(2), I am assuming it's a code of some sort. If you need it sorted by name, you might need to join it with the table with the country name on it.

-- CK
May 22 '08 #3
Delerna
1,134 Expert 1GB
i have a problem in a query like


select field1, field2
from table1
order by field1 field1 contains countries (varchar2)


the problem is that order by not shorting right , although i triyed everything..

what could be the problem ? and is there any solutions?
also, be aware that text always sorts correctly for text (ascii values) but it dosn't always sort as we humans expect it to.
May 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
4
by: Diamondback | last post by:
I have two tables, WIDGETS and VERSIONS. The WIDGETS table has descriptive information about the widgets while the VERSIONS table contains IDs relating to different iterations of those widgets...
14
by: Dave Thomas | last post by:
If I have a table set up like this: Name | VARCHAR Email | VARCHAR Age | TINYINT | NULL (Default: NULL) And I want the user to enter his or her name, email, and age - but AGE is optional. ...
2
by: Dom | last post by:
I need to run a query based on a query in Access. The second query has a number of conditions which all work well, but there is one more contition I need to set to make it run properly. the...
5
by: Ryan Hubbard | last post by:
Is it possible to get the recordset from an open query window? So you run the query. The window is open. Can vba retrieve this data?
1
by: priyadarshi123 | last post by:
Hi I am Priyadarshi I am facing problem when using shorting in GridView. Can you explain me how to use shorting in GridView,With an example of code in HTML Thank u.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.