Oh My gosh! Finally, I could able to figure out how to do this. Below is the query I used. Your hints helped me a lot. I really appreciate your help.
SELECT
A.Prod_Report, Sum(No_Of_Runs) As Total_No_of_Runs,
STUFF((SELECT ','+B.User_ID
FROM Prod_Users_Reports B
WHERE...
I am sorry. I am still unable to figure out how the WHERE clause would help in getting the concatenated users at the individual report level. My apologies. I know its not fair to ask the direct query. This is what I tried so far and getting an
error.
Sorry, if at all I caused confusion here.
I don't want to filter on report name as such. That was just an example.
This is my original query.
SELECT distinct Prod_Report,
(SELECT DISTINCT ',' + User_ID
FROM Prod_Users_Reports
FOR XML PATH(''))
FROM...
Thanks again! I realized that mistake.it was an effect of multitasking. This time I was able to concatenate, but the problem with this, it's concatenating all the users for each report.
As you can see in my previous post, for this report, "Public Folders > Power Systems > AMS > AMS Extract File...
Thank you so much for sharing that post. I could able to make use of that helpful query for my purpose. I am able to execute the query, but the result is not convincing. Because each of the reports I have one or more than one users. But my query is returning only one result for all the results...
Hi,
I am struggling in writing a query, where I need to find the sum of values from the same column and concatenate values and put them in one row from another col,umn. I tried with many options, couldn't get anything. I have explained what i want in below image. PLEASE PLEASE PLEASE SOMEONE...
Hi,
I imported a data which is in Microsoft Excel and were able to import successfully. I did this by using export/import wizard. All the data types I assigned are varchar with enough space. But when I query the table for distinct records(both count and number of records), it always returns...
Hi,
I am trying to import a data which is available in a flat file(.txt)/tab-delimited, by using export/import wizard available in SQL server. Please see the error attached and provide any solution.
Thanks,
Vijay
Hi,
I am trying to import the data in.CSV and create a table on the fly on MSSQL. It's failing for one of the columns, where it has a very long string. Please see the error attached. While importing, under Edit Mapping, I do not find any option to increase the number of characters varchar can...
There you go! You made my day sir. This query worked for me.
My apologies... I posted the image rather than the table. I will definitely follow that going forward. Thanks, once again.
Thank you so much for the reply, Duan & Olaf. Unfortunately, it seems that the above query provided by Duan is not working as it is not returning any results for the insulations with special characters. Please refer to the screenshot.
Query 1: When I execute the query provided, it retrieves the...
Hello,
I have a table in Oracle called 'OPSD_TX_TEST_RESULTS' and it has a column called 'INSULATION'. The column Insulation has some of its values as CH' and CL'. I want to retrieve data from all the columns from this table for values CH' and CL' from Insulation field along with CH and CL. So...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.