Helpful Queries: Difference between revisions

From PRAMS Plus Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 10: Line 10:
|-
|-
|Query 1
|Query 1
|<pre>
|{{
This long sentence is used to demonstrate text wrapping. This additional sentence makes the text even longer. This additional sentence makes the text even longer.
#TOTAL 5 6
</pre>
----------------------------
|Result
--Change these parameters'
#DEFINE :AGR='The Lease #'
#DEFINE :PDT='mm/dd/yyyy'
----------------------------
SELECT s.user_ref, p.name,md.prod_date, md.start_bal, md.end_bal
  FROM md_product md
  LEFT JOIN site s ON md.site_id = s.site_id
  LEFT JOIN product p On md.product_id = p.product_id
 
WHERE md.product_id IN
(SELECT product_id FROM product
WHERE site_id = md.site_id AND [type] = 'OIL' AND name = 'OIL' )
  AND s.[site_type] IN ('WEL')
  AND md.prod_date >= :PDT
      AND s.site_id IN (SELECT site_id FROM site_agree WHERE [value] = :AGR)
 
ORDER BY s.user_ref, prod_date
}}
|Some text, then {{Inline-code | 1=wfDebug( $text, $dest = 'all' );}} and more text.
|-
|-
|}
|}

Revision as of 14:09, 26 February 2020

This page contains queries that have been found useful for Prams users.


◄ QueryX2

To use one of the queries below, copy all the data and paste into QueryX2, change the parameters, then run the query.

If you are having difficulties running a query or need a new query built, call Prams at 303-904-6855.

Query 1 {{
  1. TOTAL 5 6

--Change these parameters'

  1. DEFINE :AGR='The Lease #'
  2. DEFINE :PDT='mm/dd/yyyy'

SELECT s.user_ref, p.name,md.prod_date, md.start_bal, md.end_bal

 FROM md_product md
 LEFT JOIN site s ON md.site_id = s.site_id
 LEFT JOIN product p On md.product_id = p.product_id

WHERE md.product_id IN (SELECT product_id FROM product WHERE site_id = md.site_id AND [type] = 'OIL' AND name = 'OIL' )

  		AND s.[site_type] IN ('WEL')
  		AND md.prod_date >= :PDT
     AND s.site_id IN (SELECT site_id FROM site_agree WHERE [value] = :AGR)

ORDER BY s.user_ref, prod_date }}

Some text, then Template:Inline-code and more text.




Copyright © 2026 by PRAMS Plus LLC. All Rights Reserved.