473,386 Members | 1,757 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,386 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 2242
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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?
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...

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.