Posted by Anonymous on Monday, August 8, 2011 at 12:32am.
Try the max() and min() functions.
Depending on the flavour of the SQL you're using, you could do something like:
SELECT MAX(PartCount)-MIN(PartCount) AS CountRange FROM PartsTable;
If you need a "function" and not a select statement, it depends on the SQL you're using (e.g. PL/SQL for Oracle)
Need more help on syntax and examples? Try the W3Schools tutorials.
http://www.w3schools.com/Sql/sql_func_max.asp
-1'
1
1
1
Related Questions
SQL server help! - A SQL statement is needed to create a stored procedure, which...
SQL - 1- A SQL statement is needed to create a stored procedure that has one ...
SQL for Business - By using this table: CREATE TABLE Part ( Partid int IDENTITY...
math - HOW TO SOLVE THIS? sql 8( sql 10 - 1 ) PLEASE IT IS URGENT !!!!
sql - By using this table below I need to Write a SQL statement that creates a ...
SQL - Due today Submit a text file (extension .txt). 1- Write a statement that ...
window 2003 server - You are the network administrator for a telecommunications ...
SQL Server - I have created a Database called Business with the 2 tables as ...
computer science - What is a type of operator that uses the AND, OR, and NOT? I...
Database Design (SQL) - Hi I need help creating an SQL query to display each ...
For Further Reading