tsql - Joins With CommonTable Expression - Sql -


Feedback table is like

  URL Developer Stats Review Status ------- -------------------------------------------------- Open Default.aspx Open Open default.aspx Open Open PagesSpace Open Open PageSpace Open Closed Pages Espx Close Close   

Each URL can be listed multiple times and its DStatus and Android. Rstatus can be open / closed, the status of each other is irrelevant.

I would like to list a summary like this:

  url developer status reviewer status --- ------ -------------------------------------------- ---- error ASPX OpenOpen page Open Open Open   

If at least one developer is in the form of a status open in the URL, then it should be open. Also for the receivers status.

This is my working code. How can I improve it: as TBL1 (Selection URL, Developer Status, ROW_NUMBER ()) (URL Feedback as RSS Feedback by URL Developer According to TBL2 AS (SELECT URL, Reviewer Status, ROW_NUMBER ()) (according to the order of the URL by the DESC reviewer), select the transfer f.URL, TBL1. Developer status, TBL2 Feedback from the reviewer state F. LEFT JOIN TBL1 ON f.URL = TBL1.URL and TBL1 .rn = 1 left Join T.BL2 at f.URL = TBL2.URL and TBL2.rn = 1

If I do not understand your question wrong. I can do this with the help of your group from the URL . Select

  URL, Max (Developer Stats), Max (ReviveStats).

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -