View previous topic :: View next topic
|
Author |
Message |
sameena
New User
Joined: 27 Nov 2006 Posts: 6 Location: india
|
|
|
|
Hi,
assume there is a table student with Fields subject name and marks
s 10
s 20
s 30
the number of rows in the table may vary...
now i want an sql query which returns the single row which contain s 10 20 30 i.e only single row consist of all the marks for the subjest 's' |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Rather unclear, just select columns where ____? Fill in the blank with the where clause. |
|
Back to top |
|
|
dineshness
New User
Joined: 25 Dec 2006 Posts: 63 Location: Perambalur
|
|
|
|
I guess what you are asking for is
a query to select values from one or more columns and
return it as one row, which i think is impossible.
For some reason, if you want this way
in your program to avoid the usage of cursor,
you can create a temporary table having one row with so many columns and (call a stored procedure) or (code sqls in your program) to update that temporary table with latest values. And then select it from that temporary table. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Sameena,
What is the maximum number of scores a student can have? |
|
Back to top |
|
|
jinal_mca
New User
Joined: 05 Jan 2007 Posts: 22 Location: Pune, India
|
|
|
|
Dear ur question is not clear ..
still i think if single row in ans u want u can do addition of all the marks with the help of aggregate function...
cya |
|
Back to top |
|
|
|