Questions tagged [exists]
Exists is a keyword or function in many languages, especially in SQL.
1,757
questions
0
votes
1
answer
47
views
Case expression to check if column exists throws invalid column name error
I'm building a Stored Procedure meant to be run daily. Due to how the data is provided me, some days some of the columns necessary for the output are not in the file that's imported to a temporary ...
1
vote
2
answers
81
views
Using Perl hash table to delete vowels in string, but output is always empty
I'm trying to write a short script in Perl to go through a an array of strings provided by the user, check in a hash table to see if there are vowels in the strings, then return the strings minus the ...
0
votes
1
answer
23
views
gcloud scheduler create jobs when already exist
I create my gcloud scheduler in command line with
gcloud scheduler jobs create
but when I already deploy my gitlabCI, i got already exist error.
is it possible to overwrite if already exist directly ...
-2
votes
1
answer
55
views
SQL Exists returning errors
So I have the following query:
select *
from ft, pn
where exists (ft.vendnm like '%rocha%' and pn.fno = ft.fno);
Where I only want the results that respect the conditions inside parenthesis.
What SQL ...
0
votes
1
answer
39
views
SQL Server: if column exists; invalid column name
I need to write a query that will run on different versions of a database. Some of them have a column named Delflag and some don't. If the column exists, it should be included in the select statement ...
-1
votes
1
answer
24
views
Creating an INNER JOIN from 2 tables IF condition is met
I have 2 tables, Products and Orders. If somebody creates an order, I want Product_Name01 from Orders to be filled in by the Product_Name from Products.
enter image description here
The code below ...
0
votes
1
answer
21
views
Injecting variable in nested EXEC in stored procedure
New to SQL and i'm working on a separate network so i can't share snippets (sorry) so bare with me please.
I have a stored procedure that has a table injected, based on this table i want it to run a ...
0
votes
2
answers
83
views
Select greatest n per group using EXISTS
I have a RoadInsp table in Oracle 18c. I've put the data in a CTE for purpose of this question:
with roadinsp (objectid, asset_id, date_) as (
select 1, 1, to_date('2016-04-01','YYYY-MM-DD') from ...
-1
votes
1
answer
55
views
Can a staticText be detected if its label which is variable contains "curly quotes"?
I need to assert the existence of a generated staticText on the screen.
The staticText's label is the result of:
An input text done by the user (variable!)
Curly quotes that have been added at ...
0
votes
0
answers
34
views
Infinite loop when I updated query to add an additional variable
I have this query:
with users_having_connected as (
select u.id as user_id,
(a.connected_at is not null) has_connected
from core_user u
join core_profile p on u.id = p....
5
votes
4
answers
88
views
How to return upon encountering first "true" in a List[IO[Boolean]] in Scala Cats Effect
Say I have a set of rules that have a validation function that returns IO[Boolean] at runtime.
case class Rule1() {
def validate(): IO[Boolean] = IO.pure(false)
}
case class Rule2() {
def validate(...
0
votes
1
answer
34
views
Exclude records from table
I have a parent and child table where a parent reference number has multiple entries in child table with status Pending, Success and Rejected. I need a query which will give me an output of only ...
1
vote
1
answer
56
views
Join values of two tables that represent the missing values between those tables in SQLITE
I have the following table
CREATE TABLE holes (`tournament_id` INTEGER, `year` INTEGER, `course_id` INTEGER, `round` INTEGER, `hole` INTEGER, `front` INTEGER, `side` INTEGER, `region` INTEGER);
With ...
-1
votes
1
answer
49
views
MySQL - SELECT all patient that are prescribed X but NOT Y
I have a database with a table that lists all medications that are prescribed for each patient.
I'm trying to filter to obtain patients that have been prescribed X but NOT Y.
Patient has been ...
-2
votes
1
answer
43
views
Find missing rows in one table based on another table in Sqite3
I have two tables, tournaments and pinsheets. The tables looks as follows:
CREATE TABLE "pinsheets" (
"tournament" INTEGER,
"year" INTEGER,
"course&...
1
vote
1
answer
32
views
Select only those values that are not contained by another line entirely
I have a table like
user_id
thing_id
start
end
1
1
2022-01-01
2022-01-31
1
2
2022-01-05
2022-01-10
1
3
2022-02-01
2022-02-05
2
4
2022-01-01
2022-01-01
2
5
2022-01-02
2022-01-04
I want to select ...
1
vote
1
answer
27
views
how to Increment optional sub-fields using $inc operator?
this are sample documents of the collection,
{
_id: ObjectId("637f1128d8298d42bae0d4fc"),
name: 'Iska Paphat',
age: 8,
cat: { name: 'Malone Poppelhoffen', age: 7 }
},
{
...
0
votes
1
answer
24
views
NOT IN/ NOT EXISTS || I am trying to get the IDs missing in a specific date. The table now tracks date and ID if manifested only
I have a table with Date, ID and Volume such as in below:
Date
ID
Volume
23/11/22
999
10
23/11/22
888
10
23/11/22
777
10
22/11/22
888
10
22/11/22
777
10
I would like the ID to appear in the ID ...
0
votes
0
answers
13
views
Understanding Sub-Queries: Where Exists and IN
When do you use "Where Exists" and when do you use "IN" in a subquery? Is the "where exists" clause associated consider a correlated query?
I'm struggling to understand ...
1
vote
1
answer
22
views
Check value between two tables (MS ACCESS)
I have two table:
table1:
colName
values: Ford, Audi, Opel
table2:
colNewName
values: 87 Ford Carl, one9 Audi, _12br Opel 45X
How to write query, to check if values from table1 exist into table2?
...
0
votes
2
answers
62
views
SQL - How to get a duplicate column based on the value of another column
I have a query that return values based on a boolean column: if the id_crsp includes a boolean true AND false, then it is selected.
Values of id_crsp that have only a true or false value are not ...
1
vote
1
answer
22
views
MySQL: Break query after one row found
I have a two tables:
wallets
movements
where the relationship is wallet.id = movements.wallet_id
I want to check if any wallet has done a certain type of movement
What I do is:
SELECT w.*,
...
0
votes
1
answer
17
views
cplex error: cos float doesnot exists i.e,showing error while typing cos and sin functions
error correction. I have to include cos and sin functions in my model.But it is showing error.I have tried the expression Math.cos and Opl.cos But both won't work. The error is after the forall ...
1
vote
1
answer
44
views
How to return ids of rows with conflicting values?
I am looking to insert or update values in an SQLite database (version > 3.35) avoiding multiple queries. upsert along with returning seems promising :
CREATE TABLE phonebook2(
name TEXT PRIMARY ...
1
vote
1
answer
55
views
Checking existence of several user's network "Profile Folder" from list of usernames
Trying to reach out to one server (by name) and search for the Profile DIR for each username's existence from the list of users, whom I need to delete. After many many attempts, still seeing a result ...
0
votes
1
answer
32
views
Why does this .bat program recognize a path as existing when it doesn't?
not my code just something I've been assigned to figure out/fix.
C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE does not exist- I've checked hidden files as well. C:\Program Files (...
1
vote
1
answer
35
views
Iterate over table to find a substring
My table :
TABLE texts:
(txt TEXT UNIQUE):
blob
abcdef
WhAt7228
_0jap
...
For txt I want to find substring in a given string (for example "megablob"). if IS_SUBSTR(txt, &...
0
votes
2
answers
11
views
Try to find folder name "temp.dll" by using Directory.Exsits()
I'm having a problem with what i asked on the title.
In my program, I'm trying to wrap a dll file with folder.
When I made the folder name as same as file name and try to find existance with Directory....
1
vote
1
answer
137
views
SAS macro if exists
If the dataset dataset_1&x._&y. exists, I want to get data from it, but if it doesn't exist i want to get data from dataset_2.
I have tried the following macro but it doesn't work:
%macro ...
0
votes
2
answers
20
views
If key exists i json file
Loading a normal json file. How do I find if this key exists in json string
-> jsonstreng["kjoretoydataListe"][0]["kjennemerke"][1]["kjennemerke"]
Doing this of course ...
0
votes
1
answer
38
views
I want to convert exist clause into In clause of the following query
SELECT SupplierName
FROM Suppliers
WHERE EXISTS (SELECT ProductName FROM Products
WHERE Products.SupplierID = Suppliers.supplierID AND Price < 20);
I want to convert the existing ...
1
vote
1
answer
45
views
Conversion of “where exists” SQL clause to Django ORM
I want to convert below PostgreSQL query into Django ORM. It would be great if someone can help me out here.
Query:
select U0.*
from audit_audithistory U0
where exists
(
select U2.historyId
from (...
1
vote
2
answers
75
views
How to filter out a table using SQL query?
I am new to SQL and having a hard time to filter out a table using SQL query. I have a table as below
CATEGORY | NAME | UID | LOCATION
-----------------------------------...
0
votes
1
answer
34
views
function using exists function in R
I am trying to create my own function to avoid the duplication of data object and I created following code:
check_data_exist <- function(data){
if(exists("data")==TRUE){
z=y
} ...
0
votes
2
answers
26
views
How to replace IN CLAUSE USING EXISTS?
select
TV.ATTRIBUTE
FROM
TABLE_VALUE TV
WHERE
TV.NUMBERS IN (SELECT MAX(TV1.NUMBERS) FROM TABLE_VALUE TV1
WHERE TV.UNIQUE_ID=TV1.UNIQUE_ID GROUP BY UNIQUE_ID )
0
votes
1
answer
29
views
Returning rows that contain text from another table
I have two tables Main and Lookup
Main has a column called [Promotion Codes List] that is a string of different promo codes comma separated.
Lookup has a column of all the individual promotion codes ...
0
votes
0
answers
164
views
spark.read.format("parquet") - Path does not exist
I'm trying to load a list of parquets based on a range of days (GCP, PySpark), but I don't know if every item within the range exits, so I checked the existence first.
start_day = '20220701'
start_day ...
-1
votes
3
answers
212
views
How to delete folders created older than last 7 days with C#?
The folder structure is Year/Month/Day. For example, in 'C:\folder\2022\09' there are folders named 1 to 30 (because there are 30 days in august). Likewise, in the next days, a folder will be created ...
-1
votes
1
answer
43
views
In SQL, how to join multiple foreign keys IDs in multiple columns of a table to a single primary key in another table and uniquely select one?
Table A: Patient Encounters With Linked Diagnoses(DX)
Encounter_ID
Date
Primary_DX
DX_2
DX_3
DX_4
11111
01/01/2020
234234
256756
254537
678688
11112
05/01/2020
344564
234553
6786667
234234
11113
...
0
votes
1
answer
41
views
NOT Exists with Inner Join
Class_List table
Class_List_id
Class_id
341
4
342
4
Lesson_CLass table
Class_List_id
Lesson_id
341
22
342
22
I am trying to work out a NOT EXIST IN query, which finds all the Class_List_ids in ...
1
vote
2
answers
60
views
How to check if at least one element of a list is included in a list column?
Some mock data:
test_data = [('1', '[tech, fx]'),
('2', '[industry, computer]'),
('3', '[5G, Apple]')]
test_data = spark.sparkContext.parallelize(test_data).toDF(['id', 'text'...
1
vote
3
answers
79
views
If rows exist in table then return value from table ELSE return a default value. - MySQL
I have to write a query which will return the latest timestamp column's value from a table if rows exist.
If there is no row(s) in table then it return the default value.
I have write the following ...
0
votes
0
answers
576
views
java.io.FileNotFoundException: /storage/emulated/0/Download/file.jpg: open failed: EEXIST (File exists) in kotlin
I am making a function to download a file from a server. The function to download the file works fine. However, when the user enters the file explorer and manually deletes the file and tries to ...
0
votes
0
answers
147
views
check if there is a value in the SQLite database
Hello everyone i am recently learning to react native. I have a problem with a method. I would like to check if the uid = "1111" field is present in the User_Table database. If the uid field ...
0
votes
0
answers
50
views
How to check if a value exists in another column of a same table in OBIEE?
How do I check if EmpID EE# exists in SupervisorID column and categorize it based on Manager or Individual Contributor in OBIEE.
Here's the table for reference. Currently, consider there are only 2 ...
1
vote
1
answer
32
views
Update mysql table only if all entries of another table match a certain condition
is it possible in MySQL to update a certain table only if all of the rows of another table match a certain condition? Let me give you an example with a database having two tables:
TableA: id INT, ...
1
vote
1
answer
20
views
Python check sqlite data exits?
I wrote few lines of code to check if data exist in database as below:
def check_if_data_exists(self):
with self.connection as mycur:
result = mycur.execute(f'select 1 from Summary1 where &...
-2
votes
1
answer
104
views
Generalized way to remove empty row given by aggregate functions
Example:
CREATE TABLE NumberTable (
Number INTEGER NOT NULL
);
The below query would give an empty NULL row when no data is present.
SELECT MAX(Number) AS MaxNumber
FROM NumberTable;
The NULL ...
-3
votes
1
answer
75
views
Generalized way to remove empty row given by aggregate functions in SQLite
The below query would give an empty NULL row when no data is present in the Table or when WHERE fails.
SELECT MAX(Number) AS Number
FROM Table
WHERE Number > 10;
The NULL row result looks like ...
1
vote
1
answer
90
views
SQL: NOT IN vs NOT EXISTS strange behavior
In my searching for answers, I seem to only be finding explanations that cover the existence of NULL which is why the NOT IN returns 0 results. However, my scenario is exactly the opposite. I'm ...