Home » Other » General » Help with Data SUPPORT and LIFT (oracle 9i)
Help with Data SUPPORT and LIFT [message #310883] Wed, 02 April 2008 13:51 Go to next message
jlbovo
Messages: 8
Registered: February 2008
Junior Member
I need a little help with a problem. I have to come up with Association Rules for a table that I have. I must also do the support and lift for them.

Is there an easy way to calculate this, for the table has over 800 records.

I have done the COUNT function to get a count of single items from the table. I must do them for two items and some have three or more items and I can not get a count to COUNT all.

For example, I used this code to count how many records were on Monday.
SELECT COUNT(DAY_ID)
FROM FACT5
WHERE DAY_ID = 1;
....and then I used this code to find Males in the tables..
SELECT COUNT(SEX_ID)
FROM FACT5
WHERE SEX_ID = 1;


How do i find out how many records have Monday(day_id = 1) and that are Males(sex_id = 1).

Any help would be appreciated.
Thanks - Justin.
Re: Help with Data SUPPORT and LIFT [message #310889 is a reply to message #310883] Wed, 02 April 2008 13:55 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Include all conditions into the WHERE clause, such as
SELECT COUNT(*)
FROM fact5
WHERE day_id = 1
  AND sex_id = 1;
Re: Help with Data SUPPORT and LIFT [message #310899 is a reply to message #310883] Wed, 02 April 2008 14:48 Go to previous message
flyboy
Messages: 1903
Registered: November 2006
Senior Member
Alternatively (when combining with another counts), you may use CASE expression inside the COUNT function:
SELECT COUNT( CASE WHEN day_id = 1 AND sex_id = 1 THEN 1 END )
FROM fact5;
Previous Topic: project ideas
Next Topic: crash dump file
Goto Forum:
  


Current Time: Tue Nov 26 05:24:40 CST 2024