-
-
Save micha/9ce484f7ea7320a66d3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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