Home » Other » Training & Certification » Interesting SQL Query
Interesting SQL Query [message #293460] Sun, 13 January 2008 01:31 Go to next message
agrawalpramil
Messages: 3
Registered: January 2008
Junior Member
Below is the input and output for a sql query:

Input Output

12 12.00
12.1 12.10
12.12 12.12
12.123 12.12

For any above input to sql statement there should be corresponding
output.

1. Is there any sql function available for this purpose?
2. How to write query without using any sql function to perform this?
Re: Interesting SQL Query [message #293463 is a reply to message #293460] Sun, 13 January 2008 01:34 Go to previous messageGo to next message
BlackSwan
Messages: 25045
Registered: January 2009
Location: SoCal
Senior Member
Who knows.
your input, your output, your function.
Re: Interesting SQL Query [message #293465 is a reply to message #293460] Sun, 13 January 2008 01:40 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What did you try and/or search?
Are you expecting we do your homework for you?

Regards
Michel
Re: Interesting SQL Query [message #293471 is a reply to message #293460] Sun, 13 January 2008 01:54 Go to previous message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"Inputs" are numbers. "Output" is a formatted number. In order to format it, use the TO_CHAR function.

In SQL*Plus, you might use the SET NUMFORMAT to force desired output format. Other (GUI) tools (such as Forms or Reports Builder) will allow you to specify desired format for each item/field.
Bold terms can be researched at ./fa/1681/0/.
Previous Topic: zig-zag calculation in pl/sql (merged)
Next Topic: Binary Search
Goto Forum:
  


Current Time: Wed Dec 07 20:23:24 CST 2016

Total time taken to generate the page: 0.05357 seconds