Skip to content

Select from a result of another select

I am trying to select results from the result of another select but I am getting an error. Below is the sql query. select reference,date, bdx_name, bdx_id, description, …

Adding customers name alongside customer name

based on the DB schema I am trying to get for each customer the Id, date, customer name and the customer. Can anyone help? I am struggling with adding the name of the customer. This is what I have …

Updating a column across the table going in loop, how do avoid?

Below update statement is running in a loop, how do i avoid this? I have 86Million rows in the table Table Data as below Desired table should be Thank you, Yum Answer Assuming that your query runs, you seem to need a where clause. I would speculate: Note that I removed gw from the group by. It is used as

SUM with Multiple Conditions

I’m writing a query on SQL Server and have hit a wall on cumulative sum with multiple conditions. I need to sum all the purchases in a day made by a user, I can do it separately, sum purchases by day(Daily_Total), or sum purchases by user(User_Total), but I run into a wall when I need both conditions me…

identifier ‘NEW.CITY_POPULATION’ must be declared

I am trying to declare a oracle trigger that will update the city name when the city population reaches 0 but I am getting this error. Answer If you’re going to reference the :new pseudo-record in a trigger body, it needs to be prefixed with a colon. A trigger on cities generally cannot query the cities…

Select rows where the title contains any term from a list

I have a datset that has product_id, product_url, email, product_title, etc. I want to pull rows where product_title contains certain adjectives (Fabulous, Stunning, Rare, Amazing, Unique, etc etc. ) from a list of 400+ words. How do I do this without doing a separate select function for each word? I am using…