Skip to content
Advertisement

Tag: sql

Correct BigQuery SQL to get value from previous partition

I am trying to use a window function to get a value from the previous partition/window frame (rather than from some other row in the same partition). I don’t fully understand how I can do this but have tried various combinations of using: partition clause but with LAG() function omitting partition clause and using an ORDER BY + a RANGE

SQL Server full-text search gets only one value

It only gets one value back is it possible to get multiple values inside? Like get test, test1 and test2. Answer Looking at each of the three fully visible example rows: ID=25 No match, because IsDeleted is 1 ID=26 Match. This is the row you see in the results. ID=27 NO MATCH, because Contains() matches full words by default. This

C# Multiple comboBoxes used in MySQL Where

Im trying to learn using MySQl with C# so im creating app that allow sorting and adding data to my tables. That is code that i use to show items selected only by my comboBox_1 value. But now i want to add 2nd comboBox and show data that meets both conditions. The problem is i have no idea how to

How to convert fields to JSON in Postgresql

I have a table with the following schema (postgresql 14): message are only string, phrases. sentiment is a string, only one word classification are string but can have 1 to many word comma separated I would like to create a json field with these columns, like this: Also, if possible, is there a way to consider the classification this way:

SQL Group by JSON arrays

So I have a JSON variable (var2), which is an array. I have the following data: I’m trying to write a query that gives back the number of dollars and the machines per group: Example: I’m not used to JSON arrays and it’s kinda tricky for me. I’ve tried many things and I can’t find much documentation with examples for

Postgres : using computed variable in a SELECT statement part 1/2

I’m having a SELECT statement as follow (doesn’t work): Is there a way to “inject” here the “variable” age_normin the query ? EDIT: Asked a similar question here, but this time with an additional column in the SELECT statement, which is the use case I’m trying to solve Answer We can calculate the age_norm column in a subquery and then

Advertisement