Skip to content

Determining Where Date Ranks | BigQuery

I have purchase data that I’m trying to analyze. I’m attempting to find the 2nd and 3rd purchases (and potentially 4, 5, etc.) for each user. The data I have currently looks like this: The first order column is looking at what was in the first basket that the customer purchased. Is there a way I c…

Sum data based on columns

Table 1 has several columns with distinct values. What I want is this information combined and condensed to the different column levels, so that the sale and value amounts are sum’d based on the product and type in the year and months instead of each distinct line being displayed as a separate value. For exam…

mySQL foreach row run an update

Progress table has progressId, lessonId and uniqueId TestResults table has progressId TestResults table now has lessonId and uniqueId This SQL statement foreach progrssId in TestResults will get lessonId and uniqueId from Progress: Now I want to update lessonId and uniqueId in TestResults table foreach associ…

Create table from a table in SQL Server

Below is the query I tried to execute in SQL Server: I get this error: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ‘(‘ I did some research on google to understand and isolate the error, but, failed to do so. Could anyone please help me understand the error. Thank you Answer SQL-Server…