Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > All Other Wrox Books
|
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 15th, 2003, 10:59 AM
Registered User
 
Join Date: Jun 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning Databasees with PostgreSQL -- CAST

Hello,

I have a question about the use of CAST. For example, look at the SELECT statement on page 195:

===========================================
SELECT i.item_id, i.cost_price, s.quantity
FROM item i LEFT OUTER JOIN stock s
ON i.item_id=s.item_id AND s.quantity>2
WHERE i.cost_price>CAST(5.0,NUMERIC(7,2));
===========================================

The following seems to work just as well and gives the same result:

===========================================
SELECT i.item_id, i.cost_price, s.quantity
FROM item i LEFT OUTER JOIN stock s
ON i.item_id=s.item_id AND s.quantity>2
WHERE i.cost_price>5.0;
===========================================

Why is the CAST needed?





Similar Threads
Thread Thread Starter Forum Replies Last Post
php and postgresql crmpicco PHP Databases 0 February 23rd, 2007 08:34 AM
tomcat with postgreSQL alejo_torres BOOK: Professional Apache Tomcat 0 October 14th, 2005 09:15 AM
Upgrading Postgresql 7.1.3 to 7.3.3 ganesh15 PHP How-To 1 September 3rd, 2003 11:07 PM
Beginning Databases with PostgreSQL captdeuce Wrox Book Feedback 1 August 22nd, 2003 11:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.