Here above the data is grouped by person then their duties are listed : I need a way to get the data to look like this using oracle sql : having a bit of trouble iterating over every row… dont mind if its plsql – sql prefered tho Tried a few things… but it goes back to null after the
Tag: sql
how to make search bar without having to type double quotation?
hello everyone i am trying to make this search bar in java but when i search without typing double quotation i get this error search error image but when i type numbers or words with double quotation it works just fine searching with double quotation image here is my code Code image ididn’t wirte anythi…
Coming up with logic to be able to add a time interval if the same date exists for the same clip#
I am trying to separate out a clip if it has the same date. For example, since “Clip Number” 1 and 2 has the same date so I am trying to make the date different by adding a 6 hour interval. I would like to add a new field that is similar to the column “New Date” Date Clip_Number New
LEFT JOIN WHERE not returning results
There are two tables with columns and I’m doing a basic LEFT JOIN: Case 1 Result: All good! Case 2, applied on same records Result: I was expecting to return doe’s records but it returned nothing. What am I missing? Answer Ah, the wonderful world of NULL handling. The problem arises when doing a c…
Merge two tables and chain id fields in order
I’m looking for a way to merge two tables (or more) and modify/order their numeric id. To put it simply here is what I want to do schematically : Table example 1 : Id Field 4 x 1 x 5 x 3 x 2 x Table example 2 : Id Field 1 x 3 x 5 x 2 x 4
SQL – Get multiple values when limit 1
If I have a table like this: And use this query: SELECT ident,COUNT(*) FROM sales WHERE status=? AND team=? AND DATE(date) = DATE(NOW() – INTERVAL 1 DAY) GROUP BY ident order by COUNT(*) DESC LIMIT 1 I get the value: cucu1, since that has the most rows. But if my table is like this: It should return bot…
Replace values based on JOIN
Let’s say I have two data sets A and B After left join I should get FALSE value for Y in table A as it doesn’t have it in table B Answer Using your approach, if you intend to get a value of FALSE if the value doesn’t exist you can check for NULL in the name. The example below
Difference between JOIN and Inner JOIN in Sybase
I have a query like below. I don’t understand the difference between join vs inner join used on the below code. Aren’t they the same? This is written for Sybase. Please help me know the difference. Answer According to the standard INNER JOIN=JOIN. I think, Sybase does not break this rule
Deduce End date from a list of StartDate
I have the following data table And I would like to add another column corresponding to the EndDate, with the EndDate of one ID being the StartDate of the next. So it means the following result: Activity ID StartDate EndDate A 1 10/02/2021 11/02/2021 A 2 11/02/2021 12/02/2021 A 3 12/02/2021 ?? B 1 08/02/2021 …
Are inner parenthesis needed in the WHERE clause? or anywhere
In the WHERE section or anywhere really where you have multiple conditions like OR’s I know outer parenthesis are required but are the inner ones? For example my assumption is that Is the same as writing However if we remove the outer parenthesis then I know the query will be different. Example: And Are…