473,396 Members | 1,765 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.

order by is ambiguous

I could not find any discussion on this but imho this seems an erroneous
error occuring now in 7.3.4 (after upgrade from 7.2.3):

select null::time, 'test'::varchar as time order by time;
ERROR: ORDER BY 'time' is ambiguous

The solution is to name the time datatype e.g.

select null::time as xyz, 'test'::varchar as time order by time;

Regards,
Alfred
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #1
3 2593
Travel Jadoo <ja***@xs4all.nl> writes:
I could not find any discussion on this but imho this seems an erroneous
error occuring now in 7.3.4 (after upgrade from 7.2.3): select null::time, 'test'::varchar as time order by time;
ERROR: ORDER BY 'time' is ambiguous


What's erroneous about it? You have two output columns named 'time'.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #2
On Thu, 2004-01-08 at 16:09, Tom Lane wrote:
Travel Jadoo <ja***@xs4all.nl> writes:
I could not find any discussion on this but imho this seems an erroneous
error occuring now in 7.3.4 (after upgrade from 7.2.3):

select null::time, 'test'::varchar as time order by time;
ERROR: ORDER BY 'time' is ambiguous


What's erroneous about it? You have two output columns named 'time'.

regards, tom lane


Hmm but the first one has actually no name, it's just casted as datatype
time. I now realise that casted columns get assigned the datatype as
name. Should it not show ?column? as output just like you a "select
null;" would do?

This actually came up as I have multiple time fields but only one was
named time by me.

Regards,
Alfred

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #3
> Hmm but the first one has actually no name, it's just casted as datatype
time. I now realise that casted columns get assigned the datatype as
name. Should it not show ?column? as output just like you a "select
null;" would do?


i think you're confusing what the front end uses as a default column
heading with what the back end uses as a default column name. '?column?'
would probably not meet SQL standards.
--
Mike Nolan

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #4

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

Similar topics

11
by: jguilford | last post by:
I have created a SQL Stored Procedure that uses a Case statement to determine the Order By. For one of the Case statements I am trying to turn a Char field into Datetime in for the Order By,...
9
by: xuatla | last post by:
compile error: test1.cpp:21: error: ISO C++ says that `T mtd::CDiffOperator::getdp(const mtd::mVector&, long int, mtd::mBCTYPE) const' and `void mtd::CDiffOperator::getdp(mtd::mVector&, const...
1
by: Alex Zhitlenok | last post by:
Hi, My question is how to resolve in C# ambiguous overloaded operators? Let say, I have two unrelated classes A and B, each one implements overloaded operator + with the first parameter of type...
19
by: Babis Haldas | last post by:
i have if(i==1 && func1() ) do something if i!=1 , func1 doesnt run at all this is in my compiler is this because the compiler or because the stantard can i rely that in any system...
9
by: Prasad | last post by:
HI, I am a beginner in VC++.. I am trying to write a Win32 console application in visual studio.. I am using following header files.. #include <STRING> using namespace std; #include...
3
by: Arpan | last post by:
The following code exists in a class file named "Users.vb": Namespace Users Public Class UserDetails Public FirstName As String Public LastName As String Public UserName As String Public...
1
by: rn5a | last post by:
Consider the following code in a VB class file: Namespace LoginUserFetchDB Public Class ZForZebra : Inherits SoapHeader Public UserName As String Public Password As String End Class Public...
8
by: xtrigger303 | last post by:
Hi to all, I'm working on a smart pointer implementation and I'm trying to get automatic type conversion between different pointer types. I stumbled upon something weird (at least for me) I...
12
by: Nathan Sokalski | last post by:
I have several CustomControls that I have written for my project. However, when I try to compile I recieve the following warning & errors: Warning 32 Could not resolve this reference. Could not...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...

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.