Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQL equivalent query

Status
Not open for further replies.

chillay

Programmer
Jun 27, 2002
102
0
0
US
Hello

Can anyone write a MYSQL query that is somewhat equivalent to the following?

CREATE PROCEDURE CountPhoneNumbers
AS
DECLARE @count INTEGER
SELECT @count = COUNT (*)
FROM Customer
WHERE HomePhone IS NOT NULL
Print @count



Thank you!
 
Code:
DELIMITER //
CREATE PROCEDURE CountPhoneNumbers()
  BEGIN 
    SELECT  COUNT(*) 
    FROM    Customers
    WHERE   HomePhone IS NOT NULL;
  END //
DELIMITER ;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top