I am trying to find out star date and end date for the employee time clock. Following is the example of the data I have. Output wanted: I have to find the start date and end date of the person based on eventtime and activitycode. The start date will be event time column and I have to calculate end date
Finding an ID not in another column
I’m working on a little SQL exercise, and am scratching my head an this problem. I am trying to find all the Employees to whom no other employee reports to. This is what the employees table looks …
SQL change a table into another format
I have a table like this: Faculty Program Number_of_enrolled Science Financial Modelling 25 Science Actuarial Science 30 Science Statistics 28 Science Biology …
Row lumping, cycle dates
I want to look at the lead type and if that type is the same for that row then merge in those dates to fit within one row. I have the below table: Expected Results: How can I get my output to look like the expected results? I have tested withlead lag rank and case expression but nothing worthy of
How to convert UNIX epoch seconds to Timestamp in Snowflake?
I could not find any function in snowflake docs that can do this.
SQL to pivot a field with CASE WHEN
My table has fields: Item, AttributeNo_, AttrbuteValue. Each AttributeNo_ has a matched AttributeName. e.g. Item, AttributeNo_, AttributeValue A, 1, Yellow A, 2, Round …… …
Stuck on final SQL query
I’m busy creating a report and am stuck with how to structure the final query. I have a sub-query that returns the following result set I need the final query result to look like this: I know I can …
MySQL = Grouping Sales Count by Months, then Displaying months as Names (Jan, Feb…DEC) not Numerical Value (1,2,3-12)
This seems like a reasonably simple problem but I cannot figure out how to change a numerical value of a month into the months actual name after the sales count is grouped by the month. Basically I …
SQL: Retrieve Distinct for different columns
I have the following scenario: In a SQL-Table I have the following columns: |—————————————-|————————————-| | Col 1 |…
How to select a record if it is equal to any record of a column from a different table?
I have a table with adresses, which were separated by spaces into different columns. Since the name of the streets can be made up from 1-2-3 etc. parts, the street suffices are placed in different …