Skip to content
Advertisement

Tag: sql

Where should I modify?

This is an oracle sql. SQL servel says “there is no USERS Table” but user table exists in my db. Answer You don’t need the table name.

SQL GroupBy for Stored Procedure caused Error

I have a quick question that why my SQL Stored Procedure did not work properly. Can someone explain what is wrong with my Stored Procedure Query? Error: “Each GROUP BY expression must contain at least one column that is not an outer reference.” Answer It can never work the way you are trying it, because by definition, all column names

SQL aggregate function on result of another aggregate function

Short backstory for this question. I am a student who works part-time as a tutor for several classes, including an entry level SQL class. I’ve got a student who has a fairly complicated database, compared to what most people get out of this class. Since their database ins’t super simple, they’e run into a problem trying to get a number.

Dummy Column in SQL Query

I am working on a SQL query and I need to do a calculation and store the result in dummy column in the output. I am doing the calculation as shown above however I am still missing something. Any help will be greatly appreciated. Answer SQL doesn’t allow for you to do computation on data being computed in the same

Create a column based on conditions in select statement

I have an order table in Postgres with order number and status as column. If a new order is placed the default status were Order placed and Goods Assigned. order 12345 order 543223 I want to know if the order were out from the sender place. So I want to create a column called started and has value Yes if

SQL Where data is equals to 2 different values

I have the following query: I want to return rows where reservation is anything EXCEPT ‘no-show’ or ‘removed’ Right now it’s returning rows still that are ‘removed’ I ran the command directly in sql and the same problem 🙁 Answer Use NOT IN: You seem unfamiliar with the rules of boolean logic. Your logic is interpreted as: But you actually

Advertisement