title: Declare a variable in Oracle SQL to use in a query
body: <p>Hi I am trying to declare a variable to use in Oracle SQL select query as such:</p>
  
  <pre><code>DECLARE 
    myDate DATE;
  BEGIN
  SELECT Source as "Source", DT as "Date", Status as "Status", COALESCE("Count", 0) as "Count"
  FROM (Huge SubQuery that includes many WHERE date between x and y);
  END;
  </code></pre>
  
  <p>I need to use myDate for the query so I dont have to update it in 10 places everytime I run the query.  Basically its just for declaring a variable that can be used in a where date is between clause in several places.</p>