Skip to content

Instantly share code, notes, and snippets.

@micha

micha/view.clj Secret

Created September 27, 2015 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micha/9ce484f7ea7320a66d3f to your computer and use it in GitHub Desktop.
Save micha/9ce484f7ea7320a66d3f to your computer and use it in GitHub Desktop.
(defview campaigns
[:id
:networkid
:name
:isactive
:brandid
:brandname
:startdate
:enddate
:servedimpressions
:totalimpressions
:clicks
:price
:deliverystatus
:salespersonid
:salespersonname
:__title__]
"
SELECT
c.Id
, c.NetworkId
, c.Name
, c.IsActive
, c.BrandId
, b.Title AS BrandName
, c.StartDate
, c.EndDate
, c.ServedImpressions
, c.TotalImpressions
, c.Clicks
, c.Price
, c.DeliveryStatus
, c.SalespersonId
, l.Name AS SalespersonName
, c.Name AS __title__
FROM TheLounge_Campaign c
LEFT OUTER JOIN TheLounge_Login l
ON (l.Id = c.SalespersonId)
AND (l.IsActive = 'true')
AND (ISNULL(l.IsDeleted,0) = 0)
INNER JOIN TheLounge_Brand b
ON (b.Id = c.BrandId)
AND (b.IsActive = 'true')
AND (ISNULL(b.IsDeleted,0) = 0)
WHERE (ISNULL(c.IsDeleted,0) = 0)
AND (ISNULL(c.Type,1) = 1)
")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment