this is what I got: and I want to change this part as, for now I get the raw data of rssi, for example any digits between 0 and 120.. but now I want to change the rssi result if the data is in between certain range. For example, if rssi is between 0 and 20, its 1. if its
Tag: sql
How can I add condition based on select value (JSONB) on PostgreSQL 12?
I want to filter rows that have gold badges. I am using PG12 and I use new path feature of it. To clarify, I have a users_tbl table like this: CREATE TABLE users_tbl ( ID serial NOT NULL PRIMARY …
SSAS – check if the user has a role assigned
I’m trying to create a way to partially automate creation of roles and role permissions in SSAS multidimensional cube. Due to some restrictions on my side this can only be done with using T-SQL to generate XMLA scripts and sending them to SSAS server. I have XMLA scripts to create, update and delete rol…
SQL query for subtracting values from columns and add it to same row
As you can see, the Menge column is decreasing its value for every row, subtracting the Reserviert value from the previous row. Can anybody suggest how to write this type of query in SQL Server? Answer It Cannot be Done by SQL Only . It must to be done by Code
How to retrieve the last record in each group with DB2?
As for MySQL, I know how to retrive the last record in each group, such as: But DB2 is a little bit different, you can only select column which is used after GROUP BY, like this: So, if I want to fetch two columns, I need to GROUP BY them like this: here comes the problem, I can’t retrieve the
Group by multiple columns and limit per group – Postgres
I’m creating a messaging app as a side project and I’m trying to query a user’s conversations efficiently. The messages table structure is basic right now with some dummy data: I’d like to be able to query the DB and group by “conversation” – A.K.A any rows that have …
Postgres Compare string to number return correct result
Trying to understand how postgres compare string to number because following queries return true, Can someone please explain? Answer PostgreSQL applies implicit conversion where necessary and possible. How it does this is no further explained as far as I know. (https://www.postgresql.org/docs/9.1/typeconv.htm…
Replace with single quote to double single quote not working in PostgreSQL 12
Replace with single quote to double single quote not working properly in PostgreSQL 12, it was working fine in PostgreSQL 11. PostgreSQL 12 Query: SELECT REPLACE(patient.note,””,”””), * FROM patient Output Text: Medicare Secondary Veteran�s Administration PostgreSQL 11 Query: SEL…
AnalysisException: No matching function with signature: rtrim(VARCHAR(40), STRING)
I have the value of 58.3308% in the table(include % character), I need output of 0.583308, and the SQL query as below works fine in SQL console But I get this error in my python code, it’s a hive/impala problem, right? AnalysisException: No matching function with signature: rtrim(VARCHAR(40), STRING) Th…
How to list the most expensive and the cheapest item in each category in Oracle SQL?
So I need to get a list of categories and then get the most expensive item and then the cheapest item out of each category. Then I need to sort these categories by the sum of min and max price in ASC order. I’ve tried this: Now this partially works. It does give me a list of categories ordered, it