Hi Andy,
On Jan 2, 2004, at 7:15 PM, Andy Lewis wrote:
Is it possible to sort by two columns? Using the query below?
SELECT table1.name, table2.name, FROM table1,
table2 WHERE table1.id = table2.id ORDER BY
I want to be able to sort the names select from two different tables
and
two different
Title: Message
SELECT * FROM customers ORDER BY last_name,
first_name
Works for me.
- Original Message -
From:
Andy Lewis
To: [EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 8:15
AM
Subject: [SQL] sort by on two
columns
Hi
All,
Is it possible to
Sounds like you may want to concatenate the columns:
... order by table1.name || table2.name
The sorting would then be performed on both of the them as though they
were one column.
Adam Ruth
On Jan 2, 2004, at 8:04 PM, Michael Glaesemann wrote:
On Jan 2, 2004, at 8:55 PM, Andy Lewis wrote:
Ye
On Jan 2, 2004, at 8:55 PM, Andy Lewis wrote:
Yes, I understand this but, I would like to have the results of both
"table1.name, table2.name"
sorted as one column.
Is this possible?
So you want one column of name, including names from both table1 and
table2? In that case, you need to use UNION, I
Hi Michael,
Yes, I understand this but, I would like to have the results of both
"table1.name, table2.name"
sorted as one column.
Is this possible?
Thanks,
Andy
-Original Message-
From: Michael Glaesemann [mailto:[EMAIL PROTECTED]
Sent: Friday, January 02, 2004 8:40 PM
To: Andy Lewis
On Fri, Jan 02, 2004 at 05:49:46PM +0100, Samuel Tardieu wrote:
>
> select texten, total
> from (select protocolid, count(*) as total) from ips where catid=1
^
+--- There
> group by protocolid order by pr
Title: Message
Hi
All,
Is it possible to
sort by two columns? Using the query below?
SELECT table1.name,
table2.name, FROM table1, table2 WHERE
table1.id = table2.id ORDER BY
I want to be able to
sort the names select from two different tables and two different colums(same
data type)
On Fri, Jan 02, 2004 at 05:49:46PM +0100, Samuel Tardieu wrote:
> In PostgreSQL 7.4, the following select:
>
> select texten, total
> from (select protocolid, count(*) as total) from ips where catid=1
> group by protocolid order by protocolid) as c
> inner join protocols using (protocolid)
On 3/01, Samuel Tardieu wrote:
| On 2/01, Michael Glaesemann wrote:
|
| | I'm not quite sure what you want the query to return, but you've got a
| | problem with your parentheses.
|
| I can't believe this :) I got hit by the "inner query needs to be aliased"
| message and added it to the wron
On 2/01, Michael Glaesemann wrote:
| I'm not quite sure what you want the query to return, but you've got a
| problem with your parentheses.
I can't believe this :) I got hit by the "inner query needs to be aliased"
message and added it to the wrong place and them munged the query a lot.
The c
Samuel Tardieu <[EMAIL PROTECTED]> writes:
> In PostgreSQL 7.4, the following select:
> select texten, total
> from (select protocolid, count(*) as total) from ips where catid=1
> group by protocolid order by protocolid) as c
> inner join protocols using (protocolid);
> gives the error mes
Hi Sam,
I'm not quite sure what you want the query to return, but you've got a
problem with your parentheses. You've got two FROM clauses and an INNER
JOIN, which together aren't arranged properly. I've rearranged your
query a little, but I haven't changed anything. Perhaps this'll make it
a l
In PostgreSQL 7.4, the following select:
select texten, total
from (select protocolid, count(*) as total) from ips where catid=1
group by protocolid order by protocolid) as c
inner join protocols using (protocolid);
gives the error message:
ERROR: subquery in FROM must have an alias
HIN
13 matches
Mail list logo