473,811 Members | 3,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why would my ORDER BY clause have no effect? DESC and ASC have the same effect


It doesn't matter whether I do this:

SELECT cbId, cbMainContent, cbDateCreated FROM mcContentBlocks WHERE
cbWhichType='re sultMessages' AND
cbBelongsToWhic hWebsite='.publ icdomainsoftwar e.org' ORDER BY
cbDateCreated ASC
or this:
SELECT cbId, cbMainContent, cbDateCreated FROM mcContentBlocks WHERE
cbWhichType='re sultMessages' AND
cbBelongsToWhic hWebsite='.publ icdomainsoftwar e.org' ORDER BY
cbDateCreated DESC
In both case the results are reaching the screen in the same order.
Where should I check for problems?

Aug 16 '05 #1
2 1227
lk******@geocit ies.com wrote:

It doesn't matter whether I do this:

ORDER BY
cbDateCreated ASC

ORDER BY
cbDateCreated DESC

Where should I check for problems?


On a list for your DBMS (whatever that is). You might want to tell them
which DBMS you R using and which version.

C.
Aug 16 '05 #2
*** lk******@geocit ies.com wrote/escribió (15 Aug 2005 23:17:17 -0700):
In both case the results are reaching the screen in the same order.
Where should I check for problems?


Before reaching PHP level, try to debug your SQL query in your favourite
SQL client. If your query is correct, then paste some PHP code. Otherwise,
you know where to look further.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Aug 16 '05 #3

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

Similar topics

4
6183
by: Bryan Harrington | last post by:
Can you use Select top 40 * from ... and ORDER BY... in the same query? I have the following 4 quearies that are.. for the most part, the same except the order by clause, all return a differnt amount of records. Thoughts? select top 40 * from q_work_list where assigned_to = 10 order by batch_date, remit_amt desc 40 records returned.
6
10897
by: Doug Baroter | last post by:
Hi, I'm wondering if there's any advance order by 'function'/workaround, which is reasonably efficient for MS SQL Server, without resorting to some third party indexing/search engine to achieve the following. The mechanism is to record each instance of a pattern match and order by rows with most matches first (DESC). Simplistic match but that's a separate issue.
7
2755
by: JJ_377 | last post by:
Can someone tell me why SQL seems to ignore my order by clause? I tried to run through the debugger, but the debugger stops at the select statement line and then returns the result set; so, I have no idea how it is evaluating the order by clause. THANK YOU! CREATE proc sprAllBooks @SortAscend varchar(4), @SortColumn varchar(10)
3
15256
by: handaman | last post by:
I am having problems retrieving some data from a table, Tablename = "Magazine" Columns MagazineID MagazineName 1 2 Times 3 People 4 National Geographic 5 US
1
1558
by: Blake | last post by:
Below is the queries and the results I get when in psql monitor> QUERY 1: SELECT id,price FROM store ORDER by price ASC; RESULT : List from LOWEST price to HIGHEST price QUERY 2: SELECT id,price FROM store ORDER by price DESC; RESULT : List from HIGHEST price to LOWEST price These work fine, but when I throw this into the mix:
26
17217
by: GreatAlterEgo | last post by:
Hi, This is my query which is embedded in a COBOL program. EXEC SQL SELECT DATE, AGE, DURATION, AMT INTO :LDATE, :L.AGE, :L.DURATION, :L.AMT FROM TAB1 WHERE CODE = :KEY.CODE AND SET = :KEY.SET AND DATE <= :KEY.DATE
2
2005
by: phillip.s.powell | last post by:
SELECT s.id, s.first_name, s.last_name, IF(s.school_year_id = 0, s.school_year_other, y.school_year_alt_display) AS school_year_name FROM student s LEFT OUTER JOIN school_year y ON s.school_year_id = y.id ORDER BY upper(school_year_name) desc, upper(s.last_name) asc, upper(s.first_name) asc This query produces records based upon either the column s.school_year_id being 0 and s.school_year_other having a value, or
7
6310
by: mandible | last post by:
Hello I'm trying to have some control on how my data is ordered depending on an input parameter my question is in a stored procedure how can I do something like this at the end of my statement. pOrder as input value where pOrder can be 1 or 0
0
2311
by: rkandas | last post by:
Order by based on input Select col1, col2, col3 from table 1 order by col1 <ASC/DESC>, col2 <ASC/DESC>, col3 <ASC/DESC> The sort order for col1, col2, col3 are parameters to the program. Can anyone explain how to parametrize the sort order without using a dynamic sql. DECLARE cursor clause based on parameter DECLARE CURSOR csr1 <SCROLL/NOSCROLL> CURSOR
0
9724
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10127
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.