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