Putting the results of a query into new table in SQL Server

I want to insert query results into new table is there any way I can make changes in code so that it gets stored in a table. My query: SELECT DISTINCT TOP 5 a.DocEntry ,b.TrgetEntry ,b.itemcode ,a.DocNum AS ‘Order No.’ ,a.CardCode ,a.CardName ,b.DocDate AS [Delivery No.] ,c.targettype AS ‘Ctargettype’ ,c.trgetentry AS ‘Ctargetentry’ ,c.itemcode AS ‘c-itemcode’…

Details

Fetch list of entities then set them in many to many relation

I use doctrine in the project. I got a class Card class Card implements \JsonSerializable { /** * @ORM\Id * @ORM\Column(type=”string”) */ private $id; /** * @ORM\Column(type=”string”, length=255) */ private $sign; /** * @ORM\Column(type=”string”, length=10) */ private $number; /** * Card constructor. * * @param $sign * @param $number */ public function __construct($sign, $number) {…

Details

How to delete every second occurence of an element in a nested list – PROLOG

Suppose I have a list like [1,[2,1,[2],[3,1,1,[[3]],1,[1]],1],2,1,2,1,3] and I want to delete every second occurrence of ‘1’ from it for a resultant list of [1,[2,[2],[3,1,[[3]],1,[]],1],2,2,1,3]. So far what i’ve come up with is this: delete_second_occurrence([], [], _, _). delete_second_occurrence([X|L], [X|R], X, N) :- 0 is mod(N, 2), N1 is N + 1, delete_second_occurrence(L, R, X,…

Details