FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


SQL plus type casting?





tekanubis
Is there a way to type cast in sql plus? Basically I'm using a program that uses sql plus to query a database. When taking the average of speeds it returns a double. The thing is it's not necessary for it to, and I'd prefer it to return and int or something smaller. I tried to use the round() and ceil() functions, but it doesn't really have any affect on what the type is.

Here's an example of my query, I dumbed it down, so it's pretty much nothing now.

Code:
select time, avg(speed)
from stations
group by time;
MrBlueSky
Does this work? :

Code:

select time, (avg(speed) AS INT) from stations group by time;
tekanubis
nah, that only changes the field name, not the type. Thanks for the try though. It was worth a shot.
Related topics
Prefix 0 in int data type in SQL
MySql to SQL
Trying to move SQL database
All About WoW
AJAX tutorial [2nd part now updated]
SQL Insert
[php] Php Editor
Codeur php/sql/js? j'ai besoin d'un coup de pouce
SQL Connection
Beowulf
ADO Définition et description de propriétés de l'objet Recor
search, a bit contextual in php
How Java is different than Javascript !!
What does the + symbol before new keyword does (tuts)
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.