adspace


Code the tables statement to produce a multi-level frequency?

Answer Posted / Amit Kumar Chaurasia

To create a multi-level frequency in SQL, you can use multiple self-joins or common table expressions (CTEs). Here's an example using CTEs for a simple multi-level frequency over two categories:

WITH
categories AS (
SELECT category1, COUNT(*) AS freq1
FROM your_table
GROUP BY category1
),
subcategories AS (
SELECT category1, category2, COUNT(*) AS freq2
FROM categories JOIN your_table ON your_table.category1 = categories.category1
GROUP BY category1, category2
)
SELECT * FROM subcategories;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

does anyone "QlikView" BI tool. if you have any docs send me pls. yaparas84@gmail.com

6093


What is the purpose of Dataware Control?

1122


Hi, If any hav Informatica n DWH FAQ's,Plz do fwd to s.rajanikanth1980@gmail.com Thnx Vani

2352


Explain have you ever been in a real dilemma at work? What did you do to get out of it?

1049


Explain how to generate iqd file from framework manager?

1031