I have a simple chat functionality in my application where signed up users are able to create chat groups with other users. To store the information which user is a member in which chat I am using a …
Tag: sql
‘SET’ must be a type
I created the following types : A person can have a set of PhoneNumbers, when I try to create the Type Person : I get the following error : Errors: TYPE PERSON Line/Col: 0/0 PL/SQL: Compilation unit analysis terminated Line/Col: 1/90 PLS-00488: ‘SET’ must be a type Answer If you want an array of p…
Two conditions based on subquery. How to shorten it?
I have working query basing on 2 subqueries. I would like to know what to do to do not have to paste 2 times my big sql query and just use this two conditions in one line? Is this possible? Answer I am guessing that you really want: Unlike your query, this guarantees that the two columns are on the
Delete rows from 2 tables using a single query
I have the following database-schema: I have the following example data: CREATE TABLE computermapping ( ComputerMappingID int NOT NULL, PrinterGUID char(36) NOT NULL, ComputerGUID char(36) NOT …
Merge sql throws Unique constraint violation error
I have below two table for which when i query table TEST_RUA: select CLASS, ID_LL, ID_UU, TKR from TEST_RUA where ID_UU= ‘GV9999B12M0’ it returns: CLASS ID_LL ID_UU TKR Bond (null)…
How to pass in a comma separated list of values as a Parameter input in Oracle
I have a simple select query that I would like to pass in a Parameter in the WHERE clause which contains more than one value, (comma separated list) and the query shows results for each comma separated value ? I need to know what the syntax / method for this is in Oracle SQL. So in the Query below my
Aggregating data percentage wise based on date related criteria from a table
I have legacy tables which tracks flight and had to extract data. We have three tables named booking, airlines and flighttype. Note this is a dummy samples booking : id customer request_date airline …
How to get list of cars with a specific ID of wheel?
I have the following code snippet : I want to get the Voitures having number of Roue = 554 : What is the difference of using the table in the EXISTS subquery directly in the WHERE clause? Answer The right way to write your first query would be: This query, written this way, is doubtfully usefull, because it s…
cumulative improvement score
I have ne table of student score date college_id challenge_id student_id score 2020-10-01 C11219 CH10101 S1000 80 2020-10-01 C11219 CH10101 S1001 55 2020-10-02 C11219 CH10102 S1000 87 2020-10-02 C11219 CH10102 S1001 42 2020-10-03 C11219 CH10103 S1000 95 2020-10-03 C11219 CH10103 S1001 50 2020-10-01 C11220 CH1…
How to UPDATE a value in hive table?
I have a flag column in Hive table that I want to update after some processing. I have tried using hive and impala using the below query but it didn’t work, and got that it needs to be a kudu table …