Max, Min and Count with Group By
Hello,
i want the max, min and count of a table, which is grouped by a column
I need a combination of these two selects:
select
max(COUNTRY_S) MAXVALUE,
min(COUNTRY_S) MINVALUE
from
tab_Country
select
count(*)
from
(select COUNTRY_TXT from tab_Country group by COUNTRY_TXT) ;
The result should be one row with the max and min value of the table and with the count of the grouped by table, not the max and min of each group! - i hope you understand my question?
Is this possible in one SQL-select?
Thank you very much
Best regards
Heidi
Hi, Heidi,
HeidiWeber wrote:
Hello,
i want the max, min and count of a table, which is grouped by a column
I need a combination of these two selects:
select
max(COUNTRY_S) MAXVALUE,
min(COUNTRY_S) MINVALUE
from
tab_Country
select
count(*)
from
(select COUNTRY_TXT from tab_Country group by COUNTRY_TXT) ;
The result should be one row with the max and min value of the table and with the count of the grouped by table, not the max and min of each group! - i hope you understand my question?
Is this possible in one SQL-select?
Thank you very much
Best regards
Heidi
It's not clear what you want. Perhaps
SELECT MAX (country_s) AS max_country_s
, MIN (country_s) AS min_country_s
, COUNT (DISTINCT country_txt) AS count_country_txt
FROM tab_country
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002
Similar Messages
-
Use of SUM and COUNT with GROUP BY
All,
I have a set like below:
State DOB StartDt EndDt Desc Category MemberID SubID Code
NC 2003-01-30 2014-01-01 2014-01-31 Child B 123456 2 38
NC 2003-01-30 2014-01-01 2014-01-31 Child B 123456 2 39
NC 2003-01-30 2014-02-01 2014-05-31 Child B 123456 2 38
NC 2003-01-30 2014-02-01 2014-05-31 Child B 123456 2 39
NC 2003-01-30 2014-06-01 2014-07-31 Child B 123456 2 38
NC 2003-01-30 2014-06-01 2014-07-31 Child B 123456 2 39
NC 2014-01-17 2014-01-01 2014-07-31 Infant S 456789 1 49
NC 2014-02-04 2014-02-01 2014-07-31 Infant S 246376 3 49
-- MemberID and SubID identify 1 member
-- Member 123456 has 2 distinct "Code" i.e. 38,39 but each code has different "StartDt" and "EndDt"
-- Expected Result
State Desc Category CountOfDistinctCode TotalMonthsEnrolled
NC Child B 2 (38 and 39 for same member) 7 months (1 + 4 + 2) (Difference between StartDt and EndDt:1 (1/31/2014 - 1/1/2014) + 4 (5/31/2014 - 2/1/2014).. )
NC Infant S 2 (Same code 49 but different member) 13 months (7+6) (7/31/2014 - 1/1/2014 = 7 months + 7/31/2014 - 2/1/2014 = 6 months)
I tried doing a count of distinct Code and the summing up the member months, grouped by State, Desc, Category, but I am not able to get 2 and 7 for child, it somehow calculates Months as 14 (7+7). Please let me know what you guys suggest.OK, so we need a different approach. We need a table of numbers, a concept that I discuss here:
http://www.sommarskog.se/arrays-in-sql-2005.html#numbersasconcept
(Only read down to the next header.)
We join the numbers to temp table with BETWEEN over the numbers. Then we count the distinct combination of member ID and number.
We also need to make an adjustment how to build the string for the DISTINCT. I initially assumed that your columns were integer, why I used str() which produces a right-adjusted fixed-length string of 10 characters. (The default, you can specify a different
width as the second parameter.) But str() expects a float value as input, and will fail if for instance member id would be non-numeric. We cannot just concatenate the strings, since in that case (MemberID, SubID) = ('12345', '61') would be
the same as ('123456', '1'). So we must convert to char to get fixed length. All that said, and some more test data added, here is a solution:
CREATE TABLE #Test
[State] CHAR(2),
DOB DATE,
StartDt DATE,
EndDt DATE,
[Desc] VARCHAR(8),
Category CHAR(1),
MemberID VARCHAR(10),
SubID VARCHAR(2),
Code VARCHAR(5)
INSERT INTO #Test
VALUES
('NC', '20130130', '20140101', '20140120', 'Child', 'B', '123456', '2', '38'),
('NC', '20130130', '20140121', '20140131', 'Child', 'B', '123456', '2', '39'),
('NC', '20130130', '20140201', '20140531', 'Child', 'B', '123456', '2', '38'),
('NC', '20130130', '20140401', '20140613', 'Child', 'B', '123456', '2', '39'),
('NC', '20130130', '20140601', '20140731', 'Child', 'B', '123456', '2', '38'),
('NC', '20130130', '20140614', '20140731', 'Child', 'B', '123456', '2', '39'),
('NC', '20130129', '20140601', '20140731', 'Child', 'B', '9123456', '1', '38'),
('NC', '20130129', '20140614', '20140831', 'Child', 'B', '9123456', '1', '39'),
('NC', '20140117', '20140101', '20140731', 'Infant', 'S', '456789', '1', '49'),
('NC', '20140204', '20140201', '20140731', 'Infant', 'S', '246376', '3', '49')
SELECT * FROM #Test ORDER BY MemberID, StartDt, EndDt
SELECT
[State]
, [Desc]
, Category
, COUNT(DISTINCT convert(char(10), MemberID) +
convert(char(2), SubID) +
convert(char(5), Code)) AS TotalCnt
, COUNT(DISTINCT convert(char(10), MemberID) +
convert(char(2), SubID) +
str(N.Number)) AS CalMonths
FROM #Test t
JOIN Numbers N ON N.Number BETWEEN
datediff(MONTH, '19000101', t.StartDt) AND
datediff(MONTH, '19000101', t.EndDt)
GROUP BY [State], [Desc], Category
go
DROP TABLE #Test
Erland Sommarskog, SQL Server MVP, [email protected] -
Count(*) with group by max(date)
SQL> select xdesc,xcust,xdate from coba1 order by xdesc,xcust,xdate;
XDESC XCUST XDATE
RUB-A 11026 01-JAN-06
RUB-A 11026 05-JAN-06
RUB-A 11026 08-JAN-06
RUB-A 11027 10-JAN-06
RUB-B 11026 02-JAN-06
RUB-B 11026 08-JAN-06
RUB-B 11026 09-JAN-06
RUB-C 11027 08-JAN-06
I want to make sql that result :
XDESC COUNT(*)
RUB-A 2
RUB-B 1
RUB-C 1
Criteria : GROUPING: XDESC XCUST AND MAX(DATE)
bellow mark *** that was selected in count.
XDESC XCUST XDATE
RUB-A 11026 01-JAN-06
RUB-A 11026 05-JAN-06
RUB-A 11026 08-JAN-06 ***
RUB-A 11027 10-JAN-06 ***
---------------------------------------------------------COUNT RUB-A = 2
RUB-B 11026 02-JAN-06
RUB-B 11026 08-JAN-06
RUB-B 11026 09-JAN-06 ***
---------------------------------------------------------COUNT RUB-B = 1
RUB-C 11027 08-JAN-06 ***
--------------------------------------------------------COUNT RUB-C = 1
Can Anybody help ?
I tried :
select xdesc,max(xdate),count(max(xdate)) from coba1 group by xdesc
ERROR at line 1:
ORA-00937: not a single-group group function
ThankThis one is duplicate. see the following link
Count(*) with group by max(date)
Thanks -
How can I get max, min & average (hours with minutes) of fast 30 days data
Table name:
run_log
TYPE VARCHAR2(10),
SUBTYPE VARCHAR2(10),
PROGRAM VARCHAR2(100),
STATUS VARCHAR2(20),
START_TIME DATE,
END_TIME DATE
How can I get max, min & average (hours with minutes) of fast 30 days data ?Hi,
you have to use analytical functions:
SELECT start_day,
round(AVG(daily_avg)
over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_avg,
round(MAX(daily_max)
over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_max,
round(MIN(daily_min)
over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_min
FROM (SELECT trunc(t.start_time) start_day,
AVG((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_avg,
MAX((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_max,
MIN((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_min
FROM run_log
GROUP BY trunc(t.start_time)) t
ORDER BY 1 DESCAnalytical functions are described in the Oracle doc "Data Warehousing Guide".
Regards,
Carsten. -
How to Display MAX, MIN and AVG in ALV
Hello Friends,
Can some one help me with MAX, MIN and AVG in ALV..
I am displaying a screen with ALV.. it displays 3 columns..
below every column i have done .. summatation with the help of
FIELDCATALOG-DO_SUM = 'X'.
is there any way in which i can find out MAX, MIN and AVG of each column ?
Thanking you in Anticipation.
Best Regards,
Jitesh PNO at the bottom of the screen ..
Just below the summation.
column 1 column2 column3
10 20 30
11 21 30
12 22 30
Sum 33 63 90
Max 12 22 30
min 10 20 30
AVG 11 21 30 -
Help to find the max, min and the averages wages
ok i did sum programming i got half of my program to work but i need help with the other half the program is suppose to find the highest and lowest wages and also give the average wages. here is my code
import java.util.*;
public class WorkerwagesQueues
static Scanner console = new Scanner(System.in);
public static void main (String[] args)
Queue<String> nameQ = new LinkedList<String>();
Queue<String> nameQ2 = new LinkedList<String>();
Queue<Double> num = new LinkedList<Double>();
int searchCnt = 0;
int max, min;
String toSearch, var;
System.out.println("Welcome, how are you Doing today\n");
System.out.println("Please enter the five workers names\n");
for (int i = 0; i < 5; i++)
nameQ.offer(console.next());
System.out.println("Please enter the five workers salaries\n");
for (int i = 0; i < 5; i++)
num.offer(console.nextDouble());
// starting right here is my problem
/*min = num.next(0);
max = num.get(0);
for (int i = 0; i < num.size(); i++)
System.out.println(num.get(i));
if (i > 0)
if (min > num.get(i))
min = num.get(i);
if (max < num.get(i))
max = num.get(i);
System.out.println("\nthe Lowest wage is " + num );
System.out.println("\nthe Largest wage is " + num );
System.out.println("please enter a name to serach the queue:");
toSearch = console.next();
while (nameQ.size() > 0)
var = nameQ.remove();
if (var.equals(toSearch))
{searchCnt++;}
else
{nameQ2.offer(var);}
System.out.println("This queue contains " + toSearch + " " + searchCnt + " time(s).");
System.out.println("The second queue is:");
}ok sorry if i am annoying you guys but i really want to get this working
this is the part i am having problems with. I am trying to find the max and min of the wages the user input and i am not usre how to do it. my question is how do i do that?
// starting right here is my problem
/*min = num.next(0);
max = num.get(0);
for (int i = 0; i < num.size(); i++)
System.out.println(num.get(i));
if (i > 0)
if (min > num.get(i))
min = num.get(i);
if (max < num.get(i))
max = num.get(i);
System.out.println("\nthe Lowest wage is " + num );
System.out.println("\nthe Largest wage is " + num );
-
Reading Max/Min/Av​g with labview from agilent 34401a
Hi,
I'm using Labview drivers I've downloaded from the ni.com
website to control an agilent 34401A digital multimeter. All I'm trying to do right now is read
min/max/avg measurements after putting the device into a DC current mode,
configuring it for min/max measurements, and then pausing for a couple
seconds. The program successfully puts
the multimeter into the correct modes, but always returns 0 for each
measurement. Could you take a look at
the program to see if you find a simple mistake on my part? It should be
attached to this message. Thanks very
much.
Attachments:
AVGMAXMIN.vi 421 KBI don't have the instrument or manual handy but is it possible that the instrument is waiting for a series of trigger to actually take a series of measurements. do you see the display changing? You can try setting a breakpoint at the min/max function and manually trigger the instrument to see if that makes a difference. Also, you don't need the sequence structure at all. Most of the time, sequence structures just serve to make your programs harder to read and debug. Use dataflow for controlling execution order like in the picture I've attached.
Message Edited by Dennis Knutson on 07-07-2006 02:51 PM
Attachments:
No Sequence Structure.JPG 31 KB -
Equium P200-1ED: Windows randomly max & min and refusing to close
I have an Equium P200-1ED which I biought recently and Vista keeps doing strange things with open windows.
When trying to scroll a window, click a link or perform any action with a window then the window can randomly Maximize or minimize. Also when trying to close a window it will often just 'boing' at me for 3 or 4 times after clicking the 'X' and then close.
This doesn't happen on my other vista machine so i am assuming its an issue with this one.I have managed to solve this problem.
It is caused by the synaptics touch pad software that causes it.
It is the tap zones that are much too large and interfere with operations you want to do. They seem to be set by default to change the size of the window.
So if you move the cursor upto the top right and you finger is at the top right of the pad when you tap it instead of hitting the close button it tries to do whatever is assigned to top right.
I've basically disabled the touch zones and it's behaving fine. -
Hi all.
I have installed firefox 4 and i have an issue which for start i dont know if it is supposed to be so or not.
When i maximize firefox ,Navigation bar is mixed (shown below) the orange button on the upleft of my screen.Also is shown below of the 3 windows buttons (min,max,close) of the windows 7 in the upperight of my screen.
Is this supposed to be so?
I also have some screenshots if you would like to see :
www.1dagios.com/firefox4-1.jpg
+
www.1dagios.com/firefox4-2.jpg
Thank you for your time reading this and excuse my lame English.
Regards,
The_Observer.Any news on this.
I think it has something to do with the add on : Tabgroups manager.
If i disable this add on then everything works normally.
Also when this add on is enabled my tabs are always below adress bar ,no matter what. -
Count(*) with group by and a join
I've the below tables:
Tables:
EMPLOYEE
EMP_ID LNAME FNAME
1000 SLITT JOHN
1001 SLITHER STEVE
1002 JACOB MARLYN
1003 STUFFEY NOSE
1004 SLIPPY MOUTH-----
ACCESS_TYPE
ACCESS_TYPE_ID ACCESS_DESCRIPTION
1 EMPLOYEE
2 EMPLOYEE_ADMIN
3 CONTRACTOR-----
EMPLOYEE_ACCESS
ACCESS_ID ACCESS_TYPE_ID EMP_ID ACCESS_EFF_DATE
1 1 1000 01-JAN-13
2 1 1001 10-FEB-13
3 1 1002 18-FEB-13
4 2 1003 10-OCT-12
5 3 1004 10-MAR-08-----
I'm trying to figure out the count of employees group by their type and whose last name does not start with SL
I've written the query below and I'm getting a 00936 Missing Expression. What am I doing wrong? Thanks
SELECT EA.COUNT(*) , ACCESS_TYPE_ID
FROM EMPLOYEE_ACCESS EA, EMPLOYEE E
WHERE ACCESS_EFF_DATE >= '31-DEC-12' AND E.LNAME NOT LIKE 'SL%'
GROUP BY ACCESS_TYPE_ID;
Edited by: parsar on Mar 25, 2013 3:54 PMthanks for the response.
If I don't use the alias prefix, which table rows will the query count because I've two tables in the from clause.
I've modified the query as below but it doesn't return any data:
SELECT COUNT(*) AS ACCESS_COUNT, ACCESS_TYPE_ID
FROM EMPLOYEE_ACCESS EA , EMPLOYEE E
WHERE EA.EMP_ID=E.EMP_ID AND
ACCESS_EFF_DATE >= TO_DATE('2012-12-31', 'YYYY-MM-DD') AND
E.LNAME NOT LIKE 'SL%'
GROUP BY ACCESS_TYPE_ID;Please let me know which part of the query I screwed up. -
Hello,
Below is my query
select nvl( min(csp.coeficient_value), (select csp1.coeficient_value
from csp csp1
where csp1.rule_code = 'A55' )) coeffient_value
from adr,
sec,
rpr,
csp
where adr.adr_id = sec.adr_id
and sec.account_id = 663799
and adr.pcode between rpr.start_pcode and rpr.end_pcode
and rpr.rule_code = csp.rule_code
and sysdate between csp.start_date and csp.end_date when i run this query it is giving me an error "ORA-00933: SQL command not properly ended"
Can anyone help me with this?
As i don't want to hardcode the value of rule 'A55' and want to retrieve from database.
Thanks for your help.
Message was edited by:
ABBy using below query my problem is resolved.
select nvl(coeffient_value, (select csp1.coeficient_value
from csp csp1
where csp1.rule_code = 'A55' ))
from (
select min(csp.coeficient_value) coeffient_value
from adr,
sec,
rpr,
csp
where adr.adr_id = sec.adr_id
and sec.account_id = 663799
and adr.pcode between rpr.start_pcode and rpr.end_pcode
and rpr.rule_code = csp.rule_code
and sysdate between csp.start_date and csp.end_date )Thanks to all for helping me. -
COUNT with Group By clause issue
Good Morning everyone. I have a simple query that calculates the count of 3 expressions. It is supposed to group by region and province as a result set, but instead places the TOTAL count for each expression in the region and province fields. What am I doing wrong? This is my query:
SELECT TABLE1."Province",
TABLE1."Region",
(SELECT(COUNT(TABLE1."Nationality"))
FROM TABLE1
WHERE (TABLE1."Nationality" <> 'United States'
AND TABLE1."Nationality" <> 'Nat1')
OR (TABLE1."Medical" <> 'ON MEDICAL'
AND TABLE1."Region" <> 'CONUS')
) "TCN COUNT",
(SELECT(COUNT(TABLE1."Nationality"))
FROM TABLE1
WHERE (TABLE1."Nationality" = 'United States')
OR (TABLE1."Medical" <> 'ON MEDICAL'
AND TABLE1."Region" <> 'CONUS')
) "US COUNT",
(SELECT(COUNT(TABLE1."Nationality"))
FROM TABLE1
WHERE (TABLE1."Nationality" = 'Nat1')
OR (TABLE1."Medical" <> 'ON MEDICAL'
AND TABLE1."Region" <> 'CONUS')
) "HCN COUNT"
FROM TABLE1
GROUP BY TABLE1."Province",
TABLE1."Region";
Any help would be appreciated. Thank you.
AquaBecause you are not passing any values to the inner query from the outer one..
Are you looking for this?
SELECT TABLE1."Province",
TABLE1."Region",
sum (
case when (
TABLE1."Nationality" != 'United States'
AND TABLE1."Nationality" != 'Nat1'
OR (
TABLE1."Medical" != 'ON MEDICAL'
AND TABLE1."Region" != 'CONUS'
) then 1 else 0 end
) "TCN COUNT",
sum (
case when (
TABLE1."Nationality" = 'United States'
OR (
TABLE1."Medical" 'ON MEDICAL'
AND TABLE1."Region" 'CONUS'
) then 1 else 0 end
) "US COUNT",
sum (
case when (
TABLE1."Nationality" = 'Nat1'
OR (
TABLE1."Medical" 'ON MEDICAL'
AND TABLE1."Region" 'CONUS'
) then 1 else 0 end
) "HCN COUNT"
FROM TABLE1
GROUP BY TABLE1."Province",TABLE1."Region"; -
9 days and counting with no solution...thanks verizon
8/24, all three of my tvs start experiencing pixelation where the screens constantly cut in and out along with the sound. I try the support center provided through the menu section. I try all trouble shooting methods and none fix the problem. The next day 8/25 I call verizon customer support for assistance. The gentlemen that answers has a thick accent that is very hard to understand when he speaks english so I ask to be transferred to someone who speaks english as their primary langauge. He indicates that it is impossible for him to do that so I hang up and try again with another call.
The second call leads to the next technician testing my line and restarting my tv boxes. This does not fix the problem so we schedule a technician to come out to my house. The next available time would be from 4-6pm on Wed (8/28). I was told the technician would call thirty minutes prior to arriving at my house. About 5:28pm on 8/28 i recieve a text message that my request was closed. No one ever showed up at my house and my tvs were still not fixed....I call customer support at 5:48 and ask why my request was closed, I was told that the technician found no one at home so he closed the request...I was at home the entire time anxiously waiting his phone call and arrival. Without explanation I was told my option was to make a new ticket and schedule another day for service...Needing this problem fixed I have no choice but to schedule another service date so the next available is Fri (8/30) from 2-4pm. I take off work again and sit at my house for two hours. I recieve a call from a blocked number at 3:35pm on Friday and the call drops. Minutes later I receive a voicemail notification. It's the technician telling me that there are multiple requests for service in my neighborhood so my problem is not isolated to my house. He said they were aware of the problem and would have it fixed soon so there was no need to come to my house.
Now to Sunday morning (9/1), the problem is still not fixed so another call is made to customer support. I tell the technician the problem and the history. He doesn't seem to listen to what I have told him and tries to give me steps to troubleshoot the problem.(this troubleshooting had been done 3 previous times) I ask to speak to a supervisor which he does not want to transfer me to. Eventually he puts me on through to a supervisor who doesn't listen to my actual problem but just assures me that the technician can troubleshoot the issue. (He cannot because I had already tried to troubleshoot the issue with other technicians)
So here I am 9 days from when the problem started with no solution. No management that can take care of my issue or really seem to want to take care of my issue...Directv here I come!Hi PleaseJustHelp,
Your issue has been escalated to a Verizon agent. Before the agent can begin assisting you, they will need to collect further information from you. Please go to your profile page for the forum and look at the top of the middle column where you will find an area titled "My Support Cases". You can reach your profile page by clicking on your name beside your post, or at the top left of this page underneath the title of the board.
Under "My Support Cases" you will find a link to the private board where you and the agent may exchange information. This should be checked on a frequent basis, as the agent may be waiting for information from you before they can proceed with any actions. Please keep all correspondence regarding your issue in the private support portal. -
VERY Slow on startup (10 mins) and now with programs?? help!!
Just wanted to know if any one knew some easy fixes, or is my hard drive or board on the way out??...its only 1.5 years old, so its should not have these problems...my warranty was just for one year. I love MAC but this is the second computer that seems to just expire around the two year mark, its a bit upsetting:-((((
matthew
IMAC G5 isight Mac OS X (10.4.9)No easy fixes, but try resetting your PRAM and your SMU and see if that speed things up. How much RAM do you have? IMHO, you need at least 1 GB to function with any kind of speed.
Miriam -
24 Hours and Counting with No iCloud Email
I've done all the troubleshooting steps, then called Apple support who told me the problem is with the server. It's in the Status report, although it says >1% affected. I'd at least like to report this to Apple, does anyone have a contact email?
According to the System Status page, iCloud is having issues for some people. http://www.apple.com/support/icloud/systemstatus/
The absolute best thing you can do is contact AppleCare directly. If it's a problem with your account or with iCloud's Mail server, they will know and find a fix for you.
You can schedule a callback on Express Lane: https://expresslane.apple.com/
Also, Apple as a rule does not officially monitor these discussion boards. However, they do read feedback, and it would serve you well to let them know directly the issue(s) you are facing.
http://www.apple.com/feedback/icloud.html
I encourage anyone who is experiencing issues with iCloud to contact AppleCare and submit feedback via the link above.
Maybe you are looking for
-
HP Officejet Pro 8500A unable to be listed in the available printers
My HP Officejet PRO 8500A suddenly disappeared from the list of available printers on my MacBook Pro. I went through all list of testing w/o success. The wireless test report says no wireless internet connection. There may be a MAC filter on the wire
-
How do I update ios in an older touch?
I have a 2nd gen 8gb touch that I want to upgrade to a more recent ios. I'll be brief. How? I can't seem to find anything that even tells me what version is installed. Thanks in advance. Doc
-
I want to change my iPod mini's name!
See subject. Have had a rethink, and now want to change the name of my iPod mini. But how? Nothing when I selected iPod Options... after right-clicking Hynzy's iPod mini (the name of my iPod mini) in iTunes 4.9 for Windows. Help me please!
-
I accidentally put all my tabs in one group. I'd like to get rid of the group without closing all the tabs in it; in other words, to undo putting all the tabs in one group. It would be useful to know how to remove a tab from a group without closing t
-
I recently had the conversion installed in my 2003 BMW so that I can use my ipod in my car instead of having to constantly change out cd's. It will work fine for a while but then I will lose the ability to change songs and change playlists. The only