i’m using SQL Developer 19.1. I have a huge script with multiple subselect statements. It looks like this i want to get var1 and var2 with a another select statements. How do i do that? i tried but it seems like i cant use a where statement there. i also tried something with bind or @var1.. Do you guys have
Tag: select
Concatenate 2 rows into one in SQL
I have a very simple data structure with just 3 tables: requests employees teams Basically, what I need is to concatenate 2 different SQL selects into one (so that the query could return just one row). If there’s an employee associated with a request, then return their name (title) and concatenate it with ‘ / ‘. Then, if there’s a
SQL select of records from table A but not in table B
Please, can someone help me find the SQL statement that select all records in TABLE_A except those whose combination of FIELD_1, FIELD_2 is not present in TABLE_B. (In DB2) Answer You can simply use NOT EXISTS:
Mysql Select X rows after specific match
I’m trying to write a select statement in MySQL to get 5 rows after I get my match then sum how many times those numbers were repeated. Example: Raw Table id number 1 1 2 0 3 9 4 14 5 11 6 0 7 3 8 4 9 10 10 9 11 0 12 5 13 3 14 11
SQL Query : Column1 – Stores_id, Column2 – Repo_id. How to select stores with more than 1 repo?
I would like to select only stores_id with more than one repo_id. In the case below, I would like as a result: Stores 1 and 4, as they have 2 repos_id related to them. Example Table Answer If I understand you Question correct here would be a small example with having:
SQL UPDATE SET SELECT slow [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 months ago. Improve this question I have a SQL UPDATE, but runtime is too long. Record count more
Trying to get the 2 min(count()) with Ties
I allow myself to write a thread regarding a query I’m trying to make for hours now. I’m trying to get the name of the friend (friend.first_name) who refuses the most proposed dates for events. To do this I’m counting the number of proposed date and ORDER BY ASC. However, this does not take into account TIES. What I’m looking
Querying for Unique Values When The Value Exists on Multiple Rows
Thank you for reading! I want to find any value (“Name”), but I don’t want that value if it exists on the same row as a “Type” that equals “Z”. As an example, in the table below, I want all Sam and Joe records, but I do not want any Bob records, because one of the rows that Bob exists
SQL only show orders with one order row. if more rows don display anything
i´m trying to search for orders with one specific article on the order row, but if there more than one row i don´t want to see any of the rows. This is a sample of two orders where i only want to get one resault. order 9891026 has two rows and 9891025 only have one row. result order_no line_no 9891026
Is there any way in Oracle to skip a value in a select when it has been already shown?
Sorry because maybe it’s a silly question but honestly I don’t know how to handle it. Let’s imagine that after executing a select with a group by clause I have the following information: But I would like to obtain the following: In other words, I don’t want to show a previously shown value if it’s the same (in this case,