473,585 Members | 2,657 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL query...decimal s

4 New Member
Hello,
I'm attempting to query a pricing table (part_price), and I want to return all products (part) whose price (price) is extended out by three or more decimal places (.xxx). For example I want the product whose price is 10.765 (or 100.5327) to be returned, but I don't want the product whose price is 11.23 (or 7.2, or 28) to be returned. Can anyone offer any insight into my conundrum?

Thanks,
JDM
Oct 18 '07 #1
7 1995
debasisdas
8,127 Recognized Expert Expert
Kindly post the database thet you are using for the purpose.

Also post your table structure.
Oct 19 '07 #2
jdm
4 New Member
Oracle 8i

Column Data Type Null?
PART VARCHAR2 (20) N
PRICE NUMBER (22,7) N

- No PRIMARY KEY

Regards,
JDM
Oct 19 '07 #3
debasisdas
8,127 Recognized Expert Expert
Question moved to Oracle Forum.
Oct 20 '07 #4
amitpatel66
2,367 Recognized Expert Top Contributor
Oracle 8i

Column Data Type Null?
PART VARCHAR2 (20) N
PRICE NUMBER (22,7) N

- No PRIMARY KEY

Regards,
JDM
Make use of INSTR,SUBSTR and LENGTH to achieve this!!
Oct 20 '07 #5
nramrits
18 New Member
Select *
From
Part_price
Where
Price=
Decode(
Sign(
Length(substr(p rice,instr(pric e,'.')+1,length (price)))-2),1,price)
Oct 23 '07 #6
amitpatel66
2,367 Recognized Expert Top Contributor
Expand|Select|Wrap|Line Numbers
  1. Select *
  2. From
  3. Part_price
  4. Where
  5. Price=
  6. Decode(
  7. Sign(
  8. Length(substr(price,instr(price,'.')+1,length(price)))-2),1,price)
  9.  
nramrits,

Please make us of the code tags when ever you post any code in the forum which will make the code very clear and readable
Oct 23 '07 #7
jdm
4 New Member
Thank you very very much...EXTREMEL Y HELPFUL.


JDM
Oct 23 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5635
by: Oswald | last post by:
Hey, how can I set the number of decimals? Example: 5 decimals 2.12345 2 decimals 2.12 I've found something about NumberFormat in the API, but without an example I can't solve this...
2
2214
by: westjon64 | last post by:
i am fairly new to c++, i need to know how to make it so you can input decimals into a file using the cin >> a command instead of just being able to input whole numbers and also how to make it so that it outputs decimals and not just rounded off whole numbers
1
1426
by: AP | last post by:
We commonly use this method to "pivot/crosstab" table results. For example lets say there are two offices, and we want the total sales for each ofice in its own column(Next to each other). We do not want to use a crosstab query so please do not recommend it. Typically we do this. If the data is structured as follows Office Sales ...
1
3003
by: aaronm49 | last post by:
I have created an append query and I am having a problem with the format of the number column when it appends. For example. 4.5 appends as 4,a value of .5 appends as 0. I have adjusted the append query to standard format three decimal places and have done the same for the field that is being appended to in the table but nothing has worked....
6
2606
by: Donal McWeeney | last post by:
Hi, Is there a way to specify on the predefined format strings like P and N that you want displayed all the decimals in the number... for example 3 will display 3 2.1 will display 2.1 3.21 will display 3.21
3
5467
by: sshafer1 | last post by:
Hi. I have a query that I would like to run periodically to drop the data in an existing table and re-write the table with the query information. However, when I do this, some of my field formatting for calculated query fields are dropped. For example. In the query, the FIELD1= $4,500 but when the make table query is run, the FIELD1 =...
1
2112
by: Warren Thai | last post by:
I am using Access 2003. I need to export data from a query to a .txt file. I know how to do this but however there is a problem with my data being rounded. The numbers in the data have 3 decimal places but when I export the data, the numbers in the text file are rounded to 2 decimal places. How do I stop this rounding? Warren
12
2087
by: CNiall | last post by:
I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no nth-root function in Python I will do this with something like x**(1/n)....
0
1038
by: Edwin.Madari | last post by:
for nth square root: use math.sqrt n times for example ... num = math.sqrt(num) ... 5.0 all comparisons work fine for arbitrary floating point numbers... For readability print them with required precision. for example True (0.20000000000000001, 0.20000000000000001) ('0.20', '0.20')
8
3277
by: =?Utf-8?B?a2FyaW0=?= | last post by:
Hello All, why is this code is not showing the result in this format: 0.00 and showing it as only 0 Private Sub btn1_Click Debug.Print(Format$(Rnd() * 100, "0.00")) Dim d As Double = Math.Round(2250.0, 3) txt2.Text = txt1.Text \ d
0
7908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.