Imagine the following data: I am interested in returning the entries where there is a gap in the data for a particular student, where the category changes from one year to another, or both. So the output that I’m after is: The reason why id 4 would not be returned is because there is actually no gap or difference between
Tag: boolean
Add new column with Boolean in PL/SQL
I’m learning PL/SQL right now and I have a doubt. I have created the following table called tbProducts: And I have inserted some values so the table is like this: Now what I’m looking for is a boolean variable that can be called bUpdate that returns FALSE if today’s date (26-AUG-2021) is greater than dLastDate and returns TRUE if it’s
How to group distinct values and calculate fields in one SQL query
This is only my second time using Stack Overflow so I’m open to any constructive criticism on how to better format my questions. I have a list of orders and I’m wanting to create a table of useful customer information. I’ve created a new table that identifies unique customers (using just a select distinct of customer IDs) but I’m not
Return boolean if duplicates exist
How do I return True if a table has any duplicate records and False if it has none. I don’t need a count, I don’t need to know which rows, all I want to know is if this table has duplicates or …
Return 1 if number exists in table and 0 otherwise
I want to return 1 if some number already exists in table and 0 otherwise. I tried something but it doesn’t work: I want something similar to exists function that already exists in PostgreSQL, but instead of true and false I want 1 or 0. Answer EXISTS yields a boolean result. The simple way to achieve what you are asking