Yii2 Active Query как собрать такой mysql?

Как через query builder собрать вот такой mysql запрос?

SELECT t1.* FROM tsg_message t1 INNER JOIN ( SELECT chat_id, MAX(created_at) AS max_created_at FROM tsg_message GROUP BY chat_id ) t2 ON t1.chat_id = t2.chat_id AND t1.created_at = t2.max_created_at 

Если это важно, то данный запрос мне нужен в SearchModel для группировки сообщений по признаку chat_id и мне нужно, чтобы в группировку попадали только самые последние сообщения. Есть у кого-нибудь идеи?

Possible to query a document library’s content types

We’ve noticed an issue in our SharePoint 2013 document libraries. When uploading documents to a document set in a document library, content types available to the root document library are available in the document set, even if that same content type isn’t available to the document set. This is particularly challenging as users aren’t seeing their documents in document sets as they’ve been erroneously tagged as the wrong content type as is the case when users drap/drop items into document sets.

I’d like to try to modify the new document pop up to strip out these invalid content types. Is there a way to query the document set’s properties to find valid content types?

Tks

Gráfico de informação relacionada não mostra dados ordendados de acordo com query mas tabela mostra

Olá!

Tenho um painél de informação relacionada onde quero mostrar uma tabela ou gráfico de um certo tipo de dados. Abaixo tenho um exemplo da tabela:

Lista

A configuração está feita para ordenar os resultados por data. O que ocorre com sucesso na tabela.

No entanto, no gráfico essa ordenação não acontece e os dados aparecem sem a ordenação

Gráfico

A configuração que tenho é semelhante a isto:

INSERT INTO InformacaoRelacionada ([Id],[Categoria],[Config])  Values(     @myid, 'Armazens',     '<Config>     <General>         <TypeClassName>PriCloudLibrary100.CI_Lista</TypeClassName>         <Name>Values</Name>         <Title>Values</Title>         <Description>Values</Description>         <ShowDescription>0</ShowDescription>         <Height>500</Height>     </General>     <List>         <SqlQuery>               SELECT itv.CDU_Timestamp, itv.CDU_Value               FROM dbo.TDU_Values itv               WHERE itv.CDU_Timestamp between DateAdd(DD,-7,GETDATE()) and GETDATE()               ORDER BY itv.CDU_Timestamp ASC         </SqlQuery>       </List>       <Grid>         <ShowGroupBox>1</ShowGroupBox>         <ShowFooterRows>1</ShowFooterRows>         <Visible>1</Visible>         <Columns>           <Column1>             <Name>CDU_Timestamp</Name>             <Title>Date</Title>           </Column1>           <Column2>             <Name>CDU_Value</Name>             <Title>Value (%)</Title>             <DecimalPlaces>2</DecimalPlaces>           </Column2>         </Columns>       </Grid>       <Graph>         <Visible>0</Visible>         <Legend>           <Visible>1</Visible>         </Legend>         <Series>           <Serie1>             <Name>CDU_Value</Name>             <Legend>Value (%)</Legend>             <PointName>CDU_Value</PointName>             <SerieStyle>0</SerieStyle>             <LegendVisible>0</LegendVisible>             <LabelVisible>0</LabelVisible>             <ColorEach>1</ColorEach>             <DecimalPlaces>2</DecimalPlaces>             <Visible>1</Visible>           </Serie1>         </Series>       </Graph>     </Config>' ) 

Falta me alguma configuração no gráfico?

Muito Obrigado.

How to make updates to data and return list of updates without breaking Command query separation or DRY?

I have a use case to make updates to a slightly complex JSON object and then return the list of changes made (not the updated data). The process of finding the list of changes is extremely similar to the process of making the changes and it would bring in some redundancy if I chose to separate the two methods. So I’m wondering if there is a way to do this without choosing DRY over CQS and SRP.

Build query WordPress

I’m going from php to oop, through wp manuals, for the implementation of a wp query, I’m going to write these lines of code:

 <?php  global $  wpdb;  $  field_key = "address";  $  field_value = "1428 Elm St";  $  wpdb->query( $  wpdb->prepare( "INSERT INTO $  wpdb->my_custom_table  ( id, field_key, field_value ) VALUES ( %d, %s, %s )", 1,  $  field_key, $  field_value ) ); ?>  

calling global variable and implementing in the values ​​according to string, integer or float, previously I created my table my_custom_table which recalling the global variable refers to the value set in wp_config of prefix, the only thing though:

1) Value of wp_config: first_

2) table created: first_ my_custom_table

3) Created the values ​​within the table

This is not populated, why?

How MO’S algorithm with update query works?

MO’S algorithm is used to answer queries related to a given array by dividing it into blocks(https://blog.anudeep2011.com/mos-algorithm/).Though i understood general MO’S algorithm but i am facing difficulty to understand MO’S algorithm with updates (https://www.youtube.com/watch?v=gUpfwVRXhNY)

Since articles related to MO’S algorithm with updates is rare can someone who knows this algorithm can explain it.

REST query not able to filter by FileRef, works in on-premise but not online

I have a REST query which works as it should in SharePoint 2013 on-premise, but not in SharePoint Online.

The query is as follows (after encoding):

https://<tenant>.sharepoint.com/projects/1/_api/web/Lists(guid'37D38739-88BF-4EC4-B188-F334F88E2566')/Items?$  expand=File&$  select=FileRef,File/ServerRelativeUrl&$  filter=startswith(FileRef,%27%2Fprojects%2F1%2FShared%20documents%2Ftestfolder1%2F%27) 

If I remove the filter, I see all my files and folders in the result as expected. As soon as the filter is turned on, I get nothing. I can see from the the result when I don’t include the filter that several items have the value I am attempting to filter on. Changing the filter to FileRef eq ‘specific value’ yields no results either.

Is it not possible to use filter on this field in SharePoint online?

REST query not able to filter by FileRef, works in on-premise but not online

I have a REST query which works as it should in SharePoint 2013 on-premise, but not in SharePoint Online.

The query is as follows (after encoding):

https://<tenant>.sharepoint.com/projects/1/_api/web/Lists(guid'37D38739-88BF-4EC4-B188-F334F88E2566')/Items?$  expand=File&$  select=FileRef,File/ServerRelativeUrl&$  filter=startswith(FileRef,%27%2Fprojects%2F1%2FShared%20documents%2Ftestfolder1%2F%27) 

If I remove the filter, I see all my files and folders in the result as expected. As soon as the filter is turned on, I get nothing. I can see from the the result when I don’t include the filter that several items have the value I am attempting to filter on. Changing the filter to FileRef eq ‘specific value’ yields no results either.

Is it not possible to use filter on this field in SharePoint online?

REST query not able to filter by FileRef, works in on-premise but not online

I have a REST query which works as it should in SharePoint 2013 on-premise, but not in SharePoint Online.

The query is as follows (after encoding):

https://<tenant>.sharepoint.com/projects/1/_api/web/Lists(guid'37D38739-88BF-4EC4-B188-F334F88E2566')/Items?$  expand=File&$  select=FileRef,File/ServerRelativeUrl&$  filter=startswith(FileRef,%27%2Fprojects%2F1%2FShared%20documents%2Ftestfolder1%2F%27) 

If I remove the filter, I see all my files and folders in the result as expected. As soon as the filter is turned on, I get nothing. I can see from the the result when I don’t include the filter that several items have the value I am attempting to filter on. Changing the filter to FileRef eq ‘specific value’ yields no results either.

Is it not possible to use filter on this field in SharePoint online?

Can some one explain how MO’S algorithm with update query works?

MO’S algorithm is used to answer queries related to a given array by dividing it into blocks(https://blog.anudeep2011.com/mos-algorithm/).Though i understood general MO’S algorithm but i am facing difficulty to understand MO’S algorithm with updates (https://www.youtube.com/watch?v=gUpfwVRXhNY)

Since articles related to MO’S algorithm with updates is rare can someone who knows it explain it.