Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

LokiJS Complex Queries

$
0
0

@EffakT wrote:

So I am using LokiJS as a local database, although I am having some trouble replicating a MySQL query to work...
The query I am trying to replicate is:

SELECT DISTINCT advertisers_approved.*
FROM advertisers_approved
INNER JOIN advertiser_categories_approved
ON advertisers_approved.id =
advertiser_categories_approved.advertiser_id
INNER JOIN locations_approved
ON advertisers_approved.id = locations_approved.advertiser_id
INNER JOIN advertiser_times_approved
ON advertisers_approved.id =
advertiser_times_approved.advertiser_id
WHERE ( advertiser_categories_approved.category_id = 12
OR advertiser_categories_approved.category_id = 11 )
AND ( locations_approved.region_id = 5 )
AND ( advertiser_times_approved.day_id = 3
AND '1055' >= advertiser_times_approved.open
AND '1055' < advertiser_times_approved.close )

Could someone let me know if this is even possible to do in LokiJS, or will I have to do it manually, calling each item manually and filtering it manually?

It it is possible to replicate with LokiJS, could you give me some pointers?

Thanks.

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>