473,388 Members | 1,096 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,388 software developers and data experts.

query translation

Hi,

I'm trying to translate from mysql to pgsql one query as below

SELECT DISTINCT name FROM table ORDER BY surname

Referring to mysql this query was working perfectly, however when I try use
this query with pgsql I didn't achieve result

What should I do?

Why that query doesn't work correctly with pgsql?
Aug 13 '05 #1
4 2243
In article <dd**********@nemesis.news.tpi.pl>,
"gniewosh" <ne**@inso.pl> wrote:
Hi,

I'm trying to translate from mysql to pgsql one query as below

SELECT DISTINCT name FROM table ORDER BY surname

Referring to mysql this query was working perfectly, however when I try use
this query with pgsql I didn't achieve result

What should I do?

Why that query doesn't work correctly with pgsql?


Well, what result are you getting for the MySQL vs PostgreSQL?

Are you sure the same data set is in both databases?

--
Available for Hire! http://amduus.com/Resumes/
Aug 13 '05 #2
> Well, what result are you getting for the MySQL vs PostgreSQL?
Are you sure the same data set is in both databases?


There is not a problem with data only with syntax of the sql language,
because as I written I have a query with is working perfectly in mysql. This
query is giving me a list of particular records from column name which are
ordered according to column surname. When I was try to use the same query
for pgsql I have problem, because the database never return me answer.

Aug 14 '05 #3
In article <dd**********@nemesis.news.tpi.pl>,
"gniewosh" <ne**@inso.pl> wrote:
Well, what result are you getting for the MySQL vs PostgreSQL?
Are you sure the same data set is in both databases?


There is not a problem with data only with syntax of the sql language,
because as I written I have a query with is working perfectly in mysql. This
query is giving me a list of particular records from column name which are
ordered according to column surname. When I was try to use the same query
for pgsql I have problem, because the database never return me answer.

Perhaps you need to add the field to the list of columns to return. I
have to say, when I sort on columns, it is always columns I plan to
display - so I have always had my ORDER BY in the column list of the
SELECT.

--
Available for Hire! http://amduus.com/Resumes/
Aug 14 '05 #4


gniewosh wrote:
Hi,

I'm trying to translate from mysql to pgsql one query as below

SELECT DISTINCT name FROM table ORDER BY surname


I got this on my postgreSQL database:
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Then try
SELECT DISTINCT name, surname ORDER BY surname;

Regards

Sep 17 '05 #5

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

Similar topics

7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
39
by: Chetan Raj | last post by:
Hi All, One of my friend asked this question on C++ >>> Hi, Can u give an answer to this : We have the .h files for standard library. Consider any class (such as
3
by: Paradigm | last post by:
I want to create a pass through query in Access to get data from a MYSQL table. I need to do this using code so that sertain aspects of the query can be changed. When I look at the SQL version of...
12
by: alessia | last post by:
hi, I have a query that visualizes me, according to some criterions from me inserted, name , Surname , Address , phone ok.. Now, through a button, positioned in a Form, I have to only export...
11
by: DraguVaso | last post by:
Hi, I want to make a small application in VB.NET that relinks all the query's and tables in an Access database that are linked via ODBC to an SQL Server. It must be able to relink all the tables...
3
by: s_wadhwa | last post by:
Hi, I'm trying to convert MS Access 97 .mdb application to Access 2003 .adp application with SQL Server as Backend. I'm having trouble converting Access Query into SQL Query. The Query is...
1
by: Azzuron | last post by:
Hello everyone. We have a script with a periodic hanging query. What i mean, is that it sometimes seems to work, it sometimes seems to just hang up and never finish. I have identified the query to...
11
by: lenygold via DBMonster.com | last post by:
Hi everybody! This query is supposed to count consecutive years from the current year without OLAP. Input Table: ID DateCol 1 02/01/2006 1 01/01/2006 1 01/01/2005
0
by: Stef Mientki | last post by:
hello, I've build a translation tool, to translate all strings in a python source file. As a extra gadget I added translation through Babel Fish, using beautifulsoup. Although it works...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.