473,473 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

wrong order when sorting join - query result

Hi Im using access 2000. and I have a strange problem.

when I execute a query on TABLE_A (TABLE_A contains 2 colums: "id"
INTEGER and "name" MEMO)
Query1:
"select id, name from TABLE_A ORDER BY name" . I get my results OK
:-)

when I extend the query and make a join with TABLE_B (conatins 2
coulmd "ref_to_tableA" INTEGER and "value" INTEGER)
Query2:

"select id, name from TABLE_A, TABLE_B where ref_to_tableA=id ORDER BY
name"

I get the same results but nor ordered!!! it looks like the data is
ordered in 'CHUNKS'. for example I get

id name
---- -----
1 d
4 d1
5 d2
3 a
2 aa
6 c
7 c1

TABLE_A has somthing about 35K records.
TABLE_B has somthing about 2M records.

when I get the bad results from Query2 and try to resort it by right
click on the 'name' column and choose sort, It doest work either.

another point (dont know if it is important) the 'name' columns is
unix-file-name so its values are /usr/bin/.....

any help will be appriciated.

10x

Yonatan
Nov 12 '05 #1
4 3726
Yonatan Maman previously wrote:
Hi Im using access 2000. and I have a strange problem.

when I execute a query on TABLE_A (TABLE_A contains 2 colums: "id"
INTEGER and "name" MEMO)
Query1:
"select id, name from TABLE_A ORDER BY name" . I get my results OK
:-)


As I understand it, Jet SQL does not support sorting on memo fields. So
the real question is why it worked at all.

Looks like you'll have to find/create a different sort field.

Regards

Peter Russell
Nov 12 '05 #2
pr******@russellscott.co.uk (Peter Russell) wrote in message news:<me**********************@russellscott.btinte rnet.com>...
Yonatan Maman previously wrote:
Hi Im using access 2000. and I have a strange problem.

when I execute a query on TABLE_A (TABLE_A contains 2 colums: "id"
INTEGER and "name" MEMO)
Query1:
"select id, name from TABLE_A ORDER BY name" . I get my results OK
:-)


As I understand it, Jet SQL does not support sorting on memo fields. So
the real question is why it worked at all.

Looks like you'll have to find/create a different sort field.

Regards

Peter Russell


10x for the answer (I didnt know that) - but any wy I need to store
String values (longer than 255 chars) - what are my options?

Yonatan
Nov 12 '05 #3
Yonatan Maman previously wrote:
pr******@russellscott.co.uk (Peter Russell) wrote in message
news:<me**********************@russellscott.btinte rnet.com>...
Yonatan Maman previously wrote:
Hi Im using access 2000. and I have a strange problem.

when I execute a query on TABLE_A (TABLE_A contains 2 colums: "id"
INTEGER and "name" MEMO)
Query1:
"select id, name from TABLE_A ORDER BY name" . I get my results OK
:-)


As I understand it, Jet SQL does not support sorting on memo fields.
So the real question is why it worked at all.

Looks like you'll have to find/create a different sort field.

Regards

Peter Russell


10x for the answer (I didnt know that) - but any wy I need to store
String values (longer than 255 chars) - what are my options?

Yonatan


You can store whatever you want, obviously.
But are you saying you really need to SORT on more than 255 characters?

I would just create an extra field in my query containing the first 'n'
characters from the memo field, and sort on that.

Regards

Peter Russell

Nov 12 '05 #4
pr******@russellscott.co.uk (Peter Russell) wrote in message news:<me**********************@russellscott.btinte rnet.com>...
Yonatan Maman previously wrote:
pr******@russellscott.co.uk (Peter Russell) wrote in message
news:<me**********************@russellscott.btinte rnet.com>...
Yonatan Maman previously wrote:

> Hi Im using access 2000. and I have a strange problem.
>
> when I execute a query on TABLE_A (TABLE_A contains 2 colums: "id"
> INTEGER and "name" MEMO)
> Query1:
> "select id, name from TABLE_A ORDER BY name" . I get my results OK
> :-)
>

As I understand it, Jet SQL does not support sorting on memo fields.
So the real question is why it worked at all.

Looks like you'll have to find/create a different sort field.

Regards

Peter Russell


10x for the answer (I didnt know that) - but any wy I need to store
String values (longer than 255 chars) - what are my options?

Yonatan


You can store whatever you want, obviously.
But are you saying you really need to SORT on more than 255 characters?

I would just create an extra field in my query containing the first 'n'
characters from the memo field, and sort on that.

Regards

Peter Russell


10x, but I still cant understand why it works without the join?
I also check that if I remove some of the records ( both tables with
1K records) it work OK even with join - how come ???
Yonatan
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Xenophobe | last post by:
I have successfully converted the ASP code included in the following article to PHP: http://www.4guysfromrolla.com/webtech/040100-1.shtml As described the high and low latitudes and longitudes...
1
by: Scott | last post by:
I have a view that contains the following SQL1 and it takes about 500ms to run with Explain Plan EXP1. However, if I add an order by clause(e.g. select * from view1 order by ID desc), it will then...
6
by: peter pilsl | last post by:
postgres 7.3.2 I store unicode-data in postgresql. The data is retrieved via webinterfaces, processed with perl and then stored in postgresql (and viceversa). All is going nice with one...
2
by: Hohn Upshew | last post by:
I need some help to build a report enumerating the products in descending order depending on the sum of liters. In this way i can view the top products sold for a given period.But i fail to do...
6
by: Mike MacSween | last post by:
I have a report based on: PARAMETERS Forms!frmProductions!ProdID Long; SELECT Sum(qryRoleEvent.Fee) AS SumOfFee, First(qryMusician.LastName) AS LastName, First(qryMusician.FirstName) AS...
7
by: Geert Elias | last post by:
Hello all, When making a new table by running a make table query based on a table, the field I added a descending sort, is not always sorted correct. When I run the query 10 times, almost 7...
4
by: dtwalter | last post by:
Is it possible to ORDER BY a SubSelect? I don't see why it wouldn't be, but I'm having some trouble. Hopefully it's just a simple error in syntax and somebody can tell me. Here's what I'm trying...
9
by: phillip.s.powell | last post by:
Ok, you have three tables. You're supposed to be able to not only sort (ORDER BY) according to a_name, no problem, but you must also have the ability to sort (ORDER BY) the relationship between...
1
by: padmaneha | last post by:
Select distinct b.contributor, blogaddress,count(b.contentid) RecipeCount,isnull(c.cnt,0) Other from weblogs.dbo.blogentries b left outer join (select contributor , count(*) cnt from...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.