|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Avg function
I have the following query
select avg(gpa) from student. but gpa was declared as varchar. Can I do type casting of varchar so that it can be converted to a number to calculate the gpa. Regards sgatl2 |
|
#3
|
|||
|
|||
|
Yes you can.
fv Quote:
__________________
...because that is the way we have always done it. We've been doing it like that for 80 Years! (How do we change that mindset?) |
|
#4
|
||||
|
||||
|
Quote:
Using proper data type would also be good, think altering your table.
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > Avg function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|