For example here, from this table key | status 1001 | A 1001 | D 1001 | C the hierarchy will be C>D>A If the the stats contain C as the value, the person status will become C in one row. …
Tag: sql
How do I remove results based on conditions to calculate an average
I have the schema below. A quick explanation of it is: bob rated up 5/5 james rated up 1/5 macy rated up 5/5 The logic: If I am personA, look up everyone I have blocked. Look up all the movie …
EntityColumnNotFound: No entity column “authors” was found. many to many relations on TypeORM and NestJS
I am trying to get the books per user from the get request I have the following problem, it turns out that I am doing a many-to-many relationship but it indicates that the authors entity was not found,…
How can I make a query that return only the exact list of parameters
I have a table that has the ingredient information and I would like to return only if the value is exactly as the parameter I receive. The Table structure is: Name | Recipe Ingredient X | …
DataTable ‘Table’ already belongs to this DataSet – on a new DataSet?
I have a function that executes SQL queries and returns a generic DataSet of the query results. This function has been working for years in many applications, but today with a specific query I am getting “Error executing [select top (1) RecordId, SourceCID, SourceID, CaseID, DisposeRequestedDate, Dispos…
db2: how to remove the decimal from number column?
A very simple query which work the result is I want to remove the ,00000000000 to obtain I have tried cast and round but without success. I’m on Db2 This nice ltrim works fine for all type of cars but using with avg return the string with the 00000 the result is.. 🙁 Only the , is changed. Answer casting…
Fetch a set of words(char and non char seperated by space) from a sentence appearing prior to a particular words in Oracle Sql
I want to split a sentence and fetch a subset of words seperated by space , prior to a specific word in Oracle SqL. I tried regexp substring, instring but couldn’t arrive at solution. Source …
Saleforce retrieving fields from two different objects – (SOQL) Simple Salesforce Python
I am using simpleSalesforce library for python to query SalesForce. I am looking at two different object in SalesForce: Account and Backend (parent-child). The Id in account matches the records of Backend through acc_id I am trying to do this: But I get the response showing: Malformed request – didnR…
If all result equals, return true
I have a simple select that returns a single column: result: {1,1,2} I want to check if all result are 1 then return true and if one column have a 2 return false. Tried something like these: But obviously it returns true if a value is 1 and false if it is 2, instead of just one result. For example:
How to retrieve the last part (i.e. a number varies in length) of a text column of which’s length varies in Oracle and store this in another column?
I am trying to get the last number from a Oracle SQL column called Description and store it in another column called Thickness. As you see, the length of the description varies as well as the length of the number at the very end. It is sometimes a double such as 1.5, sometimes an integer like 3. I have tried