SQLTeam.com | Weblogs | Forums

Sql query for requirement


#1

Hi
I have requirement that I have one table contains two columns employee and code one employee will have 10 occurance of code range between 13 to 45
See the uloads attach images for input and out put
And idea to query


#2

This is very clearly some type of homework/assignment. Therefore, it's unethical for me to just give you the answer. You need to work thru this yourself. We can help you work yourself through it, but not do it for you.


#3

It's not a home work it's issue facing from two days I have used pivot it's not getting the result is there any ways I have asking an idea ways how can we get and daily table gets update to input table


#4

If you want folk to help with this type of problem then please post:

CREATE TABLE statement(s)
and INSERT statements to populate them with some sample data

and also an example of the expected output.

Along with the PIVOT SQL code you already have.

Otherwise each and every person here who might want to help you will have to duplicate the work of building CREATE TABLE and INSERT code, from the picture of your handwritten photo, and you will be very lucky indeed if anyone has the time to do that.

Please Format the code - otherwise the forum here will likely mangle it. Surround your code like this:

    ```sql

    Your SQL code here

    ```

    ```text

   Your results example here
    ```