Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. VijiKumara

    Help is required for writing a tricky query

    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...
  2. VijiKumara

    Help is required for writing a tricky query

    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.
  3. VijiKumara

    Help is required for writing a tricky query

    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...
  4. VijiKumara

    Help is required for writing a tricky query

    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...
  5. VijiKumara

    Help is required for writing a tricky query

    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...
  6. VijiKumara

    Help is required for writing a tricky query

    Nope. I am sorry...may I know why?
  7. VijiKumara

    Help is required for writing a tricky query

    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...
  8. VijiKumara

    Distinct query is returning weird result

    You are absolutely right! I renamed the columns & it started working. Thank you very much for the great tip!
  9. VijiKumara

    Distinct query is returning weird result

    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...
  10. VijiKumara

    unable to import a data available in a file with .txt format by using Export/Import wizard

    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
  11. VijiKumara

    Unable to Import data in .csv file using 'SQL Server Import & Export Wizard'

    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...
  12. VijiKumara

    My 'Union Query is throwing Unknown Command

    Thank you much, folks. I executed both the queries separately and also I removed the extra semicolon I added. It worked. You guys are simply awesome.
  13. VijiKumara

    My 'Union Query is throwing Unknown Command

    This is in Oracle SQL Developer
  14. VijiKumara

    My 'Union Query is throwing Unknown Command

    Select Distinct L.NM_LINE, D.nm_fac, S.TRANSFORMER_OPER_ID, S.FEEDER_NUMBER, S.INDUSTRIAL, S.COMMERCIAL, S.RESIDENTIAL, S.TOTAL from amp.tb_line L, amp.tb_sect K, amp.site D, amp.trits.feeder_customer S where K.cd_stat = 'C' and l.cd_stat = 'C'...
  15. VijiKumara

    Unable to query a a table with a value having special character 'single quote' in where clause

    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.
  16. VijiKumara

    Unable to query a a table with a value having special character 'single quote' in where clause

    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...
  17. VijiKumara

    Unable to query a a table with a value having special character 'single quote' in where clause

    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...

Part and Inventory Search

Back
Top