Selecting from DataWindow

Hi,
I am wondering if we can do kind of sql select command in DataWindow.
Suppose I have a data window with 3 columns

studentID   |   SubjectID   |   score
----------------+-------------------+------------
123            |   MT01         |    80
123            |   GO02         |    70
456            |   MT01         |    70
456            |   FS01         |     90

This is the result I am expecting

StudentID  |   maxScore           |
----------------+----------------------------|
123           | 80                        |
456           | 90                        |

In SQL it will be like this
select studentID, max(Score)
from Student
group by studentID

How do I do it if it (student table) was a datawindow?
I need it to be displayed on other datawindow control and exported to
excel after viewing it?

Can anyone help me with this?

Thank you very much.
0
jwvai316
7/17/2009 12:32:29 AM
sybase.powerbuilder.general 62418 articles. 18 followers. Follow

1 Replies
364 Views

Similar Articles

[PageSpeed] 7

jwvai316 wrote:
> Hi,
> I am wondering if we can do kind of sql select command in DataWindow.
> Suppose I have a data window with 3 columns
> 
> studentID   |   SubjectID   |   score
> ----------------+-------------------+------------
> 123            |   MT01         |    80
> 123            |   GO02         |    70
> 456            |   MT01         |    70
> 456            |   FS01         |     90
> 
> This is the result I am expecting
> 
> StudentID  |   maxScore           |
> ----------------+----------------------------|
> 123           | 80                        |
> 456           | 90                        |
> 
> In SQL it will be like this
> select studentID, max(Score)
> from Student
> group by studentID
> 
> How do I do it if it (student table) was a datawindow?
> I need it to be displayed on other datawindow control and exported to
> excel after viewing it?
> 
> Can anyone help me with this?
> 
> Thank you very much.

Try to keep you questions to one newsgroup.
0
Adam
7/17/2009 1:27:31 AM
Reply: