Questions tagged [exists]

The tag has no usage guidance.

6 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
85 views

“FOR UPDATE” in an “EXISTS SELECT” statement

Is there any potential problem in using (in a transaction) SELECT EXISTS( SELECT * FROM mytable WHERE id=36 FOR UPDATE ) i.e. having SELECT ... FOR UPDATE within an EXISTS? MySQL does certainly ...
1
vote
1answer
42 views

Weird error on creating table and selecting rows from table

I have db and I am trying to create table called "sales_invoice_grid" I am having bellow scenarios: error 1: while creating the table "sales_invoice_grid" manually, it gives the message that it ...
0
votes
1answer
58 views

Select only those records that have same multiple values for a particular column if it's existing?

Below is an example of my pricing_supports table have more than 3 milions rows. There some rows having same values in the first_origin_id, delivery_id fields. If there're records with same ...
0
votes
0answers
47 views

Executing IF Exists condition

I have a sproc that scripts out permissions and in the process, I add a check to see if the object exists before dumping the results into a table. Then, I have another re-assign permissions sproc that ...
0
votes
2answers
919 views

Select Data from two tables ONLY IF ID on both tables are SAME

I need to select returns result SELECT wl.id FROM wishlist AS wl LEFT JOIN wishlist_products AS wp ON wl.id = wp.wishlist_id Only IF ALL of wp.product_id EXISTS in wishlist_products_bought....
-1
votes
1answer
29 views

How to check existence of a value in between two columns of the same table

I have a table bills having columns id, starting_bl_no, ending_bl_no. How can I check a new bill number input is already exist in the table? id starting_bl_no ending_bl_no 1 100 ...