How can I create a temp table from a SELECT in Azure Synapse

I have the following statement that works when I omit the ORDER BY Clause or if I run it as a select and omit the create table part but I need both to ensure my generated key is sequenced correctly

Any ideas?

Msg 104381, Level 16, State 1, Line 18 The ORDER BY clause is invalid in views, CREATE TABLE AS SELECT, INSERT SELECT, SELECT INTO, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.

CREATE TABLE #demo WITH (DISTRIBUTION = ROUND_ROBIN) AS SELECT         ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS ID, as [schema], as [table],         columns.column_id as [ordinal], as [column], as [type] FROM SYS.COLUMNS   inner join sys.types           on  types.system_type_id = columns.system_type_id   inner join sys.tables           on  tables.object_id = columns.object_id   inner join sys.schemas           on  schemas.schema_id = tables.schema_id order by,,         columns.column_id  

How to create table from two alias tables with sql

I want to create a table that shows a name, position week1, position week2. I created the following queries that give the correct result for each week separately. All the data is in one table results. Server version: 10.4.14-MariaDB

 SELECT     name, team, points,week,      @curRank := @curRank + 1 AS position     FROM results,  (SELECT @curRank := 0) r     WHERE week = 1     order by points DESC 


SELECT     name, team, points,week,      @prevRank := @prevRank + 1 AS position2     FROM results,  (SELECT @prevRank := 0) r2     WHERE week = 2 ORDER BY points DESC 

But when I combine the with UNION I get an incorrect result.

(SELECT     name, team, points,week,      @curRank := @curRank + 1 AS position     FROM results,  (SELECT @curRank := 0) r     WHERE week = 1)       UNION  (SELECT     name, team, points,week,      @secondRank := @secondRank + 1 AS position2     FROM results,  (SELECT @secondRank := 0) r2     WHERE week = 2) ORDER BY points 

So how would I combine the two select statements to get the table with just name, position week1, position week2? I do not need points in the table, but points are used to calculate the position.

How to create all possible permutations?

there is a problem:

I have 5 letters – a,b,c,d,e and 20 places. I have to use each letter at least once but no more than 10 times. So the result can look like {a,a,a,a,a,a,a,a,a,a,b,b,b,b,b,b,b,c,d,e},… etc. I need to find all possibilities.

I was trying something like this:

    With[{n = 5, k = 20}, Join @@ Table[IntegerPartitions[s, {k}, Range[n]], {s, k, n k}]] 

And then changing numbers to letters. Then I can delete cases where there is no a,b,c,d or e and also cases with more than 10 same letters.

But I would prefer a solution, where I don’t have to delete these cases but I can set conditions before evaluation. Thanks for your help!

How to create metrics of specific events in Google Analytics or Data Studio?

On my site, I am firing an event when the user lands on a specific URL. I’m firing another event when the user clicks on a button on that specific page.

When I go to Analytics, I can see the Total Events + Unique events for each dimension (specific page view, button click on specific page).

How is it possible to create a new metric (I assume a calculated metric) to display the Unique Events as metrics for any dimension I’d like to use in a Table?

Here is an example of what I have now:

Event Label Total Events Unique Events
specific_page_views 100 50
specific_page_clicks 20 10

…and what I’d like to achieve:

Source Specific Unique Page Views Specific Unique Page Clicks Specific Page CTR %
(direct) 30 8 26.67
google 15 2 13.34
bing 5 0 0

I have been searching for an answer for many days now and can’t seem to find the answer to this simple question. I will want to create multiple of these Metrics, not just 2.

Is this actually possible with Google Analytics or Google Data Studio? (I’m planning to use Google Data studio)

how to create 5star review rating for testimonials without plugin in WordPress

already I have created a Testimonial post type but I face a problem which is how to create a review 5-star rating system without any plugin in the meta box. This is my 5 start rating codes here… just I wanna fix the rating problem.

Plz, anyone help me.

                            <div class="single-slider">                                 <ul class="star-list">                                  <li><i class="fa fa-star"></i></li>                                 <li><i class="fa fa-star"></i></li>                                 <li><i class="fa fa-star"></i></li>                                 <li><i class="fa fa-star"></i></li>                                 <li><i class="fa fa-star"></i></li>                                                                  </ul>                                    <?php the_content();?>                                 <!-- Client Info -->                                 <div class="t-info">                                     <div class="t-left">                                         <div class="client-head"> <?php the_post_thumbnail('testimonial-img');?></div>                                         <h2><?php the_title();?><span><?php echo get_post_meta(get_the_ID(),'meta-subtitle-Testimonials2', true); ?></span></h2>                                     </div>                                     <div class="t-right">                                         <div class="quote"><i class="fa fa-quote-right"></i></div>                                     </div>                                 </div>                             </div> 

plz check the pic which i wanna

enter image description here

Create region/limits for NMinimize from list

NMinimize can accept a region to optimize over. I’m looking to create an expression that represents a region from a list of limits e.g.

limits = {{500, 5000}, {1000, 4000}, {1000, 10000}, {1000, 50000}}; 


{500<t[1]<5000 && 1000<t[2]< 4000 && 1000<t[3]<10000 && 1000<t[4]<500000} 

However, I can’t do it from the list, this is the best I can do

variables = Table[t[i], {i, Length[taus]}]; limits = {{500, 5000}, {1000, 4000}, {1000, 10000}, {1000, 50000}};  limits = Flatten[   Table[{limits[[i, 1]] < variables[[i]] < limits[[i, 2]] "&&"}, {i,      1, Length[variables], 1}]]  (* Output is wrong: {500 < t[1] < 5000 "&&", 1000 < t[2] < 4000 "&&",   1000 < t[3] < 10000 "&&", 1000 < t[4] < 50000 "&&"} *)  

How To Create The Best Content Marketing Strategy For Your Business 2021

5 Important steps marketers won’t tell you , when creating a content marketing strategy for your business or for your social media brand account

Want a content marketing strategy that gets more leads and sales?
Today I'm going to break down the beginners guide
to make a content marketing strategy in 2021 In this video on
Create The Best Content Marketing Strategy For Your Business 2021 we'll be covering the following topics:​

  • the ultimate content…​

How To Create The Best Content Marketing Strategy For Your Business 2021