nested-queries

LINQ Include Values of children error

为君一笑 提交于 2019-12-02 15:59:39
问题 I have this query: var allValues = from p in _pContext.Persons where p.Id == currentPerson.Id from i in p.Items //This is a list that contains "Items" select i; I want to have all the Items and all the nested values that they contain. How do I load these when executing this query, too? I know theres the include statement that I can use on the context, but that doesnt lead anywhere. If I f.e. do this: var allValues = from p in _pContext.Persons.Include("Items.Properties") where p.Id ==

Understading Solr nested queries

不羁的心 提交于 2019-12-02 07:12:33
I'm trying to understand solr nested queries but I'm having a problem undestading the syntax. I have the following two indexed documents (among others): <doc> <str name="city">Guarulhos</str> <str name="name">Fulano Silva</str> </doc> <doc> <str name="city">Fortaleza</str> <str name="name">Fulano Cardoso Silva</str> </doc> If I query for q="Fulano Silva"~2&defType=edismax&qf=name&fl=score I have: <doc> <float name="score">28.038431</float> <str name="city">Guarulhos</str> <str name="name">Fulano Silva</str> </doc> <doc> <float name="score">19.826164</float> <str name="city">Fortaleza</str>

Querying the Result set of a Previous Query

五迷三道 提交于 2019-12-02 04:31:24
I have a query for example Query1 = Select Name from table where some Criteria . Now this query returns a result set of course, what I want is to query the result set of this query, for example I only want the unique Names from the above query select Distinct(Name) from Query1 . I should mention that I know I can just use distinct in Query1 but this is just an example my real scenario is somewhat different, what I want to know is whether it's possible to query the result set of a previous query. I am using SQL Server 2012. You can use the WITH clause WITH SomeClients AS ( SELECT c.ID FROM

Filtering / Querying by the Contents of a List in DynamoDB

帅比萌擦擦* 提交于 2019-11-30 14:05:14
I am attempting to filter a DynamoDB query by the contents of a Map contained within a List. Here's an example of the structure I'm dealing with. { 'EventType': 'git/push' 'EventTime': 1416251010, 'Commits': [ { 'id': '29d02aff...', 'subject': 'Add the thing to the place' }, { 'id': '9d888fec...', 'subject': 'Spelling errors' }, ... ] } The hash key is EventType and range key EventTime . I am trying to write a filter that filters the result of a query to a specific id . Is is possible to create a DynamoDB filter expression that correctly filters the query like this? (My first thought was to

Filtering / Querying by the Contents of a List in DynamoDB

冷暖自知 提交于 2019-11-29 20:33:30
问题 I am attempting to filter a DynamoDB query by the contents of a Map contained within a List. Here's an example of the structure I'm dealing with. { 'EventType': 'git/push' 'EventTime': 1416251010, 'Commits': [ { 'id': '29d02aff...', 'subject': 'Add the thing to the place' }, { 'id': '9d888fec...', 'subject': 'Spelling errors' }, ... ] } The hash key is EventType and range key EventTime . I am trying to write a filter that filters the result of a query to a specific id . Is is possible to

Are SELECT type queries the only type that can be nested?

寵の児 提交于 2019-11-27 05:42:01
Is it possible to have an non-select query (update, insert, delete) embedded into another query? Something like (an insert inside a select) A single query: select such,and,such from .... where .... insert into .... ; Basic answer There are CTEs (Common Table Expressions) in Postgres (like in any major modern RDBMS except MySQL). Since version 9.1 that includes data-modifying CTEs . Those can be "nested". Update: MySQL 8.0 finally adds CTEs. Unlike subqueries CTEs pose as optimization barriers. The query planner cannot inline trivial commands into the main command or reorder joins among main