Skip to main content
-1 votes
0 answers
123 views

I have 2 tables customers and addresses (each customer can have many addresses) The customers table has two fields of interest: userName (varchar) userID (varchar) The addresses table has two fields ...
Mike McP's user avatar
2 votes
1 answer
83 views

For each customer_id, I want to find the first delivery order. For each row of Delivery, I compare order_date with the smallest order_date of that customer_id. Why does the SELECT statement below only ...
Huy Le's user avatar
  • 2,009
-1 votes
1 answer
53 views

I have gone all around the houses with this trying to use a subqueries etc but just cannot get this to work and I am thinking it should be easy. So this is what i have: SELECT DISTINCT Register....
Paula Morrison's user avatar
1 vote
1 answer
76 views

I have a table that has store names, product codes and prices. I need to pull the minimum price of a product and display a list of the product codes with their minimum price, where it all falls down ...
Jason Ronne's user avatar
-5 votes
1 answer
100 views

I want to query table2 to get results having field field_b which corresponds to the first query result's list. (More as a LIKE; the comparison won't match perfectly). I have a table with many fields, ...
Barbi's user avatar
  • 188
1 vote
3 answers
137 views

The employee table lists the employees and the history table records hire and term dates as separate rows. I need to write a query that identifies all employees from the employee table that are ...
Elliott Buchholz's user avatar
-1 votes
1 answer
58 views

I'm trying to write a query that will join a subquery with a large union query and I'm having some trouble. Below is the subquery: SELECT DISTINCT X.JOB, FOO.PART FROM (SELECT C.PART, C.ORDER_NO, C....
THard34's user avatar
-2 votes
1 answer
69 views

I work on this plugin for Wordpress to delete users with a subscriber role and 30 days since joining us; users are active or not. I cannot correct this error after activating. if ( !defined('ABSPATH') ...
Edward's user avatar
  • 11
-3 votes
1 answer
60 views

I am trying to copy a few fields of video information from one MariaDB table to another using a subquery, decoupling some video info from a classified ads table for later refactoring. video: id (int ...
Palm Boom's user avatar
0 votes
1 answer
73 views

I am trying to come up with T-SQL query to delete data based on these conditions: Find data that have same Email. If that user has both AllLocations 'Yes' or 'No', delete entry/entries that are not ...
Java's user avatar
  • 1,334
-2 votes
1 answer
67 views

I'm trying to retrieve employees who earn more than the department's average salary using a subquery in PostgreSQL. SELECT employee_id, first_name, salary FROM employees e WHERE e....
Wesley Stephens's user avatar
1 vote
0 answers
107 views

In Snowflake I'm trying to de-identify data stored in a JSON column based on configurations in a separate table. I created a custom SQL function DEIDENTIFY_JSON which uses a subquery to look up the de-...
Lonely Planeteer's user avatar
-1 votes
2 answers
89 views

My app has a function that deletes a specific row in a SQLite table based on the row index or position, but the table doesn't have a column that stores a row index for easy access. My app retrieves ...
ThN's user avatar
  • 3,294
-1 votes
1 answer
57 views

so I'm trying to using left join instead using not exist (which I always disliked), but somehow I'm not getting the same result. Original query that returns the correct result: select o.number, o....
Yuan's user avatar
  • 15
-2 votes
4 answers
146 views

I have a table that stores customer transaction data. I want to select all customers that have purchased item 1 (64244), but remove/ignore them from the results once they've purchased item 2 (64270). ...
Nic's user avatar
  • 23

15 30 50 per page
1
2 3 4 5
765