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

    Counting values from many fields in a table

    Thank you all for helping me out. It works and i want to say Thank you again for helping me understand more SQL.
  2. niebs2

    Counting values from many fields in a table

    LKBrwnDBA - i partially get what your doing. not to be a drag here but i dont want to code the Y,N, nulls or dashes that you have with the WITH tab section. how can i get Flags to read in and sum like you have. I started doing the sum case for each flag but that seems like a waste of time. would...
  3. niebs2

    Counting values from many fields in a table

    Yes Andy the table could look like that. There has to be some data, hence the (-) so they are not null. So by your description the result set would be: Count_Y, Count_N Count_dash Flag_1 3 0 1 Flag_2 2 2 0 Flag_3 1 2 1 ...
  4. niebs2

    Counting values from many fields in a table

    Table name = Identified, Flag_1 to Flag_14. Want to count how many members(mbr) have a flag for each flag_1 to Flag_14. Output would be:the count would be the members(mbr) who have a flag with a (Y, N, -). hope that helps. Y N - Flag_1 10 0 1 Flag_2 0 12 12 Flag_3 400 0...
  5. niebs2

    Counting values from many fields in a table

    Hello, I am trying to count how many menbers have a flag in 14 flag fields in a table.I have a table called Identified and i have those 14 flag fields that can have 3 answers (Y, N, -) in them. How would i do a count for those 14 flagged fields? i can do them independently but that seems a...
  6. niebs2

    Oracle SQL convert Oracles (+) join for SAS program

    I have the last part figured out and have it working without any problems. Thanks for getting me there. no more (+) signs. i also had to bring the cse_id and ases_id after the ON condition to help eliminate duplicate rows.
  7. niebs2

    Oracle SQL convert Oracles (+) join for SAS program

    LKBrwnDBA - thank you for the response. when i run it i get a invalid identifier on "T"."ASES_QUEST_KEY". If i take that out it runs but i get back way to many rows of data. Also the outer join (+) is still there on last row of code.
  8. niebs2

    Oracle SQL convert Oracles (+) join for SAS program

    Hello, I am trying to convert an Oracle script that uses (+) outer join sign so a SAS program that runs multiple scripts can run this as well. This script is to get an Assessment taken with all questions whether they answered them or not and return all the responses. Responses have data in the...
  9. niebs2

    Oracle SQL book?

    Thanks John for the book recommendations. I usually work on Oracle dbs mostly. But i do like to know and they tend to be similar with each other. I will check them out and see what might be better overall. I do mostly QA/BA work.
  10. niebs2

    Oracle SQL book?

    I was wondering what a good book to learn more advanced Oracle sql would be. I have a book i started to learn sql with years ago and now need to learn more since 11g has more features then i am aware of and need to learn. Book i started with is: SQL Queries for Mere Mortals(R): A Hands-On Guide...
  11. niebs2

    Get record if previous answer was no and current answer is yes

    Thank you Mufasa. I hope i can get this to work in the design they have here!
  12. niebs2

    Get record if previous answer was no and current answer is yes

    hope this is what your looking for. i also added fields to table design. CREATE TABLE NIEBS (MBR_NUM NUMBER , survey_name ,QUESTION_NUM NUMBER ,RESPONSE VARCHAR2(3) CHECK (RESPONSE IN ('YES','NO')) ,creat_DT DATE , lst_up_dt DATE (i added this...
  13. niebs2

    Get record if previous answer was no and current answer is yes

    Mufasa, That would be very hard to do since the data is not related very well and design of it is bad. I am the guy who has to deal with it as is. If you have any idea on the Date issue and how to handle that. That would help me a lot. Havent had to do date field comparisons that much and very...
  14. niebs2

    Get record if previous answer was no and current answer is yes

    I am trying to code to get the responses from a questionaire. I have to find people who based on previous questions who said "no" and and now on more recent questionaire said yes to same Question)Id. I have the tables matched to what they need but i am having problems with how to check the...
  15. niebs2

    Oracle Date function - how to find quarter for date field

    i think this might help you or get you close to what you want. just change the date field range to what you need with between. Select to_char(datefield, 'YYYY-Q') AS my_qtr, count(members) FROM table_name WHERE datefield >= to_date('01/01/2011', 'MM/DD'YYYY') group by to_char(datefield...
  16. niebs2

    Oracle Date function - how to find quarter for date field

    Thank you for your help. The last one did the trick. If i wanted to add a where clause between 2 ranges would i have to make the date field a different variable instead of to_date? Also i added instead of 'Q' i wanted it using 'Q-YYYY' to get quarter year if range is longer then a year.
  17. niebs2

    Oracle Date function - how to find quarter for date field

    Hello, I am tring to write sql to find the quarter for a date field and would like the results by quarter along with member count. So i have a date field from a table. I am getting messed up using the extract function to get the month from the date field and then finding the quarter it belongs...

Part and Inventory Search

Back
Top