List Info

Thread: sql joining two columns in one




sql joining two columns in one
user name
2006-10-09 23:27:31

Delphi 5 and SQL.

This is a problem...
-------------------------------
SELECT (FirstColumn + ' ' + SecondColumn), SUM (ThirdColumn)
FROM TableName
GROUP BY (FirstColumn + ' ' + SecondColumn)
ORDER BY (FirstColumn + ' ' + SecondColumn)

Error: Capability not supported.
--------------------------------
So, I need to join two columns in one and display results.
Everything works just fine.
But, when I put third column (SUM...) it says I need to use GROUP BY...
I need to group by (FirstColumn + SecondColumn) or just by FirstColumn.
That not working.

What should I do? Is there a solution?

Thx.

---------------------------------
How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
sql joining two columns in one
user name
2006-10-09 23:46:58

What database and version are you using?

MS SQL Server? Oracle? DBISAM? Paradox?


David Cornelius
Cornelius Concepts, Inc.
http://corneliusconcepts.com <http://corneliusconcepts.com/&gt;
Software Development, Databases, Websites

_____

From: prof. Stevan Djuranovic [mailto: grofnet%40yahoo.com">grofnetyahoo.com]
Sent: Monday, October 09, 2006 4:28 PM
To: delphi-en%40yahoogroups.com">delphi-enyahoogroups.com
Subject: [delphi-en] sql joining two columns in one

Delphi 5 and SQL.

This is a problem...
-------------------------------
SELECT (FirstColumn + ' ' + SecondColumn), SUM (ThirdColumn)
FROM TableName
GROUP BY (FirstColumn + ' ' + SecondColumn)
ORDER BY (FirstColumn + ' ' + SecondColumn)

Error: Capability not supported.
--------------------------------
So, I need to join two columns in one and display results.
Everything works just fine.
But, when I put third column (SUM...) it says I need to use GROUP BY...
I need to group by (FirstColumn + SecondColumn) or just by FirstColumn.
That not working.

What should I do? Is there a solution?

Thx.

---------------------------------
How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
sql joining two columns in one
user name
2006-10-09 23:55:00

This works fine as you have it in MS SQL Server.


David Cornelius
Cornelius Concepts, Inc.
http://corneliusconcepts.com <http://corneliusconcepts.com/&gt;
Software Development, Databases, Websites

_____

From: prof. Stevan Djuranovic [mailto: grofnet%40yahoo.com">grofnetyahoo.com]
Sent: Monday, October 09, 2006 4:28 PM
To: delphi-en%40yahoogroups.com">delphi-enyahoogroups.com
Subject: [delphi-en] sql joining two columns in one

Delphi 5 and SQL.

This is a problem...
-------------------------------
SELECT (FirstColumn + ' ' + SecondColumn), SUM (ThirdColumn)
FROM TableName
GROUP BY (FirstColumn + ' ' + SecondColumn)
ORDER BY (FirstColumn + ' ' + SecondColumn)

Error: Capability not supported.
--------------------------------
So, I need to join two columns in one and display results.
Everything works just fine.
But, when I put third column (SUM...) it says I need to use GROUP BY...
I need to group by (FirstColumn + SecondColumn) or just by FirstColumn.
That not working.

What should I do? Is there a solution?

Thx.

---------------------------------
How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )