MySQL Forums
Forum List  »  Newbie

issues about positioning declare statement
Posted by: Anshul Sharma
Date: July 03, 2024 07:53AM

DECLARE @start_date DATE='2020-01-22'
DECLARE @end_date DATE='2021-06-13'
SELECT
(DATEDIFF(DAY, @start_date, @end_date) / 30.4375) AS number_of_months;

This is my query but error shows up regarding DECLARE position which is not valid, what steps should I take to correct this issue

Options: ReplyQuote


Subject
Written By
Posted
issues about positioning declare statement
July 03, 2024 07:53AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.