Query to get the hierarchical results
Hi,
Please help me in writing a Query to get the hierarchical results. I want a result like follows...
course-----groupname---TotalMembers---NotStarted---INProgress---Completed
Course1---country1--------12---------------6----------3-------------3
Course1-----state11-------12---------------6----------3-------------3
Course1------District111--10---------------5----------0-------------0
Course1--------City1111----0---------------0----------0-------------0
Course1--------City1112----1---------------0----------0-------------1
Course1--------City1113----6---------------3----------2-------------1
Course1---country2--------12---------------6----------3-------------3
Course1----state21--------12---------------6----------3-------------3
Course1------District211--10---------------5----------0-------------0
Course1--------City2111----0---------------0----------0-------------0
Course1--------City2112----1---------------0----------0-------------1
Course1--------City2113----6---------------3----------2-------------1
Course2---country1--------12---------------6----------2-------------3
Course2----state11--------12---------------6----------2-------------3
Course2------District111--10---------------5----------0-------------0
Course2--------City1111----0---------------0----------0-------------0
Course2--------City1112----1---------------0----------0-------------1
Course2--------City1113----6---------------3----------1-------------2
Course2---country2--------12---------------6----------3-------------3
Course2-----state21-------12---------------6----------3-------------3
Course2------District211--10---------------5----------0-------------0
Course2--------City2111----0---------------0----------0-------------0
Course2--------City2112----1---------------0----------0-------------1
Course2--------City2113----6---------------3----------2-------------1
These are the Tables available to me.
(I have just given some examle data in tables, to get the idea)
"Groups" Table (This table gives the information of the group)
GROUPID-----NAME-------PARENTID
1---------Universe--------1
2---------country1--------1
3---------state11---------2
4---------District111-----3
5---------City1111--------4
6---------City1112--------4
7---------City1113--------4
8---------country2--------1
9---------state21---------8
10--------District211-----9
11--------City2111--------10
12--------City2112--------10
13--------City2113--------10
"Users" Table (This table provides the user information)
userID----FIRSTNAME---LASTNAME
user1-----------Jim-------Carry
user2-----------Tom-------lee
user3-----------sunny-----boo
user4-----------mary------mall
"User-Group" Tables (This table provides the relation between the groups
and the members)
GROUPID---userID
3-------------user1
3-------------user2
3-------------user4
4-------------user5
5-------------user6
5-------------user7
user_score (This table provides the user scores of different courses)
USERID----course-----STATUS
user1------course1-----complete
user1------course2-----NotStarted
user2------course1-----NotStarted
user2------course2-----complete
user3------course1-----complete
user3------course2-----InProgress
user4------course2-----complete
user4------course1-----NotStarted
I will explain the first four lines of the above result.
Course1---country1--------12---------------6----------4-------------2
Course1-----state11-------12---------------6----------4-------------2
Course1------District111--10---------------5----------3-------------2
Course1--------City1111----0---------------0----------0-------------0
Course1--------City1112----1---------------0----------0-------------1
Course1--------City1113----6---------------3----------2-------------1
# "city1111" group has 0 members
# "city1112" group has 1 member (1 member completed the course1)
# "city1113" group has 6 members(3 members notStarted,2 members
InProgress,1 member completed the course1)
# "District111" is the parent group of above three groups, and has 3
members.(2 members NotStarted,1 member InProgress the course1). But this
group has child groups, so the scores of this group has to rollup the
child groups scores also. Thats why it has 2+3+0+0=6 members Not
Started,1+2+0+0=3 members InProgress,0+0+1+1=2 members completed.
# "state11" group also same as the above group.
I am able to get the group hierarchy by using "Connect By" like follows
"select name,groupid,parentid from groups_info start with groupid=1 connect by parentid = prior groupid;"
But i want to get the result as i have mentioned in the begining of this discussion.
I am using oracle 8i (oracle8.1.7).
Thank you for any help
Srinivas M
This may not be exactly what you want,
but it should be fairly close:
SET LINESIZE 100
SET PAGESIZE 24
COLUMN groupname FORMAT A20
SELECT INITCAP (user_score.course) "course",
groupnames.name "groupname",
COUNT (*) "TotalMembers",
SUM (NVL (DECODE (UPPER (user_score.status), 'NOTSTARTED', 1), 0)) "NotStarted",
SUM (NVL (DECODE (UPPER (user_score.status), 'INPROGRESS', 1), 0)) "InProgress",
SUM (NVL (DECODE (UPPER (user_score.status), 'COMPLETE', 1), 0)) "Completed"
FROM user_score,
user_group,
(SELECT ROWNUM rn,
name,
groupid
FROM (SELECT LPAD (' ', 2 * LEVEL - 2) || name AS name,
groupid
FROM groups
START WITH groupid = 1
CONNECT BY PRIOR groupid = parentid)) groupnames
WHERE user_score.userid = user_group.userid
AND user_group.groupid IN
(SELECT groupid
FROM groups
START WITH groupid = groupnames.groupid
CONNECT BY PRIOR groupid = parentid)
GROUP BY user_score.course, groupnames.name, groupnames.rn
ORDER BY user_score.course, groupnames.rn
I entered the minimal test data that you
provided and a bit more and got this result
(It was formatted as you requested,
but I don't know if it will display properly
on this post, or wrap around):
course groupname TotalMembers NotStarted InProgress Completed
Course1 Universe 6 2 0 4
Course1 country1 5 2 0 3
Course1 state11 5 2 0 3
Course1 District111 2 0 0 2
Course1 City1112 1 0 0 1
Course1 City1113 1 0 0 1
Course1 country2 1 0 0 1
Course1 state21 1 0 0 1
Course1 District211 1 0 0 1
Course1 City2113 1 0 0 1
Course2 Universe 5 1 1 3
Course2 country1 4 1 1 2
Course2 state11 4 1 1 2
Course2 District111 1 0 1 0
Course2 City1113 1 0 1 0
Course2 country2 1 0 0 1
Course2 state21 1 0 0 1
Course2 District211 1 0 0 1
Course2 City2113 1 0 0 1
Here is the test data that I used, in case
anyone else wants to play with it:
create table groups
(groupid number,
name varchar2(15),
parentid number)
insert into groups
values (1,'Universe',null)
insert into groups
values (2,'country1',1)
insert into groups
values (3,'state11',2)
insert into groups
values (4,'District111',3)
insert into groups
values (5,'City1111',4)
insert into groups
values (6,'City1112',4)
insert into groups
values (7,'City1113',4)
insert into groups
values (8,'country2',1)
insert into groups
values (9,'state21',8)
insert into groups
values (10,'District211',9)
insert into groups
values (11,'City2111',10)
insert into groups
values (12,'City2112',10)
insert into groups
values (13,'City2113',10)
create table user_group
(groupid number,
userid varchar2(5))
insert into user_group
values (3,'user1')
insert into user_group
values (3,'user2')
insert into user_group
values (3,'user4')
insert into user_group
values (4,'user5')
insert into user_group
values (5,'user6')
insert into user_group
values (5,'user7')
insert into user_group
values (7,'user8')
insert into user_group
values (13,'user9')
insert into user_group
values (11,'use11')
insert into user_group
values (6,'use6')
create table user_score
(userid varchar2(5),
course varchar2(7),
status varchar2(10))
insert into user_score
values ('use6','course1','complete')
insert into user_score
values ('user9','course1','complete')
insert into user_score
values ('user9','course2','complete')
insert into user_score
values ('user8','course1','complete')
insert into user_score
values ('user8','course2','InProgress')
insert into user_score
values ('user1','course1','complete')
insert into user_score
values ('user1','course2','NotStarted')
insert into user_score
values ('user2','course1','NotStarted')
insert into user_score
values ('user2','course2','complete')
insert into user_score
values ('user3','course1','complete')
insert into user_score
values ('user3','course2','InProgress')
insert into user_score
values ('user4','course2','complete')
insert into user_score
values ('user4','course1','NotStarted')
Similar Messages
-
SQL Query to get the desired result
Can someone give the SQL to get this output.
input is like this in table.
cola colb fromdate todate
1 100 1/5/2010 1/9/2010
1 101 1/10/2010 1/25/2010
1 102 1/26/2010 12/31/2900
2 201 3/1/2011 3/10/2011
2 202 3/11/2011 12/31/2900
3 301 1/5/2010 1/9/2010
3 302 1/10/2010 1/25/2010
3 303 1/26/2010 1/28/2010
3 304 1/29/2010 12/31/2900
I want to get the output like this.
cola colb fromdate todate
1 100 1/5/2010 1/9/2010
2 201 3/1/2011 3/10/2011
3 301 1/5/2010 1/9/2010
More info:
I want to get the rows where fromdate is the min(fromdate) from each cola's unique values i.e. 1,2,3
Please let me know the SQL.
Thanks.
[email protected]This way!!!
with data(cola, colb, st_dt, ed_dt) as
select 1, 100, to_date('01/05/2010', 'MM/DD/YYYY'), to_date('01/09/2010', 'MM/DD/YYYY') from dual union all
select 1, 101, to_date('01/10/2010', 'MM/DD/YYYY'), to_date('01/25/2010', 'MM/DD/YYYY') from dual union all
select 1, 102, to_date('01/26/2010', 'MM/DD/YYYY'), to_date('12/31/2900', 'MM/DD/YYYY') from dual union all
select 2, 201, to_date('03/01/2011', 'MM/DD/YYYY'), to_date('03/10/2011', 'MM/DD/YYYY') from dual union all
select 2, 202, to_date('03/11/2011', 'MM/DD/YYYY'), to_date('12/31/2900', 'MM/DD/YYYY') from dual union all
select 3, 301, to_date('01/05/2010', 'MM/DD/YYYY'), to_date('01/09/2010', 'MM/DD/YYYY') from dual union all
select 3, 302, to_date('01/10/2010', 'MM/DD/YYYY'), to_date('01/25/2010', 'MM/DD/YYYY') from dual union all
select 3, 303, to_date('01/26/2010', 'MM/DD/YYYY'), to_date('01/28/2010', 'MM/DD/YYYY') from dual union all
select 3, 304, to_date('01/29/2010', 'MM/DD/YYYY'), to_date('12/31/2900', 'MM/DD/YYYY') from dual
select cola, colb, st_dt, ed_dt
from (
select cola, colb, st_dt, ed_dt,
row_number() over (partition by cola order by st_dt) rn
from data
) a
where a.rn = 1;
COLA COLB ST_DT ED_DT
1 100 05-JAN-10 09-JAN-10
2 201 01-MAR-11 10-MAR-11
3 301 05-JAN-10 09-JAN-10 -
Query: Not getting the desired result. Please help
QL> select * from ecev;
entity_Tag
7
8
9
10
1
2
3
4
5
6
SQL> select * from dg;
DIGP_TAG CEPT_TAG
600 1
700 1
800 1
900 1
100 1
200 1
500 1
75 2
SQL> select * from enow;
ENTITY_CODE ENTITY_TAG DIGP_TAG TARGET_DA CEPT_TAG
EXT 7 600 26-MAY-07 1
EXT 8 700 26-MAY-07 1
EXT 9 800 26-MAY-07 1
EXT 10 800 22-APR-76 1
EXT 1 100 20-OCT-06 1
EXT 2 200 20-OCT-06 1
EXT 3 500 20-OCT-06 1
EXT 4 100 20-OCT-06 1
EXT 5 100 20-OCT-06 1
EXT 6 80 20-OCT-06 1
EXT 1 75 2
SQL> select * from tk;
TK_TAG DIGP_TAG NARRATIVE DUE_DATE CEPT_TAG
35 90 raj 27-MAY-07 1
36 900 kkd 27-MAY-07 1
37 100 kim 28-MAY-07 1
30 100 ram 23-MAY-07 1
31 100 kish 23-MAY-07 1
32 200 mar 23-MAY-07 1
33 100 gy 23-MAY-07 1
34 100 mm 27-MAY-07 1
8 rows selected.
For the following query
1 select
2 d.ecev_tag ecev_tag,
3 a.digp_tag entity_owner ,
4 c.digp_tag task_owner,
5 c.tk_tag task_tag,
6 c.narrative
7 from enow a,
8 entl b,
9 tk c,
10 ecev d
11 where ( a.DIGP_TAG=100 or c.digp_tag=100)
12 and a.entity_tag=b.entity_tag(+)
13 and b.tk_tag=c.tk_tag(+)
14* and a.entity_tag=d.entity_tag
SQL> select * from entl;
TK_TAG ENTITY_TAG
35 5
36 10
30 1
31 1
32 2
33 3
34 3
Result:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG NARRATIVE
5 100 90 35 raj row1
1 100 100 30 ram row2
1 75 100 30 ram row3 1 100 100 31 kish row4
1 75 100 31 kish row5 3 500 100 33 gy row6
3 500 100 34 mm row7
4 100 row8
Row1: yes, since entity_tag 5 is owned by digp_tag 100 (enow)
Row2: yes, since entity_tag 1 is owned by digp_tag 100 (enow)
Row3: NO, since entity_tag 1 is owned by digp_tag 75, which in turn is in cept_tag 2, since the passed digp_tag is 100 and it just belongs to cept_tag 1 we should not be getting this row.
Row4: Yes, since tk_tag 31 is owned by digp_tag 100 (tk)
Row5 NO, since entity_tag 1 is owned by digp_tag 75, which in turn is in cept_tag 2 since the passed digp_tag is 100 and it just belongs to cept_tag 1 we should not be getting this row.
Row6: Yes, since tk_tag 33 is owned by digp_tag 100 (enow)
Row7: Yes, since tk_tag 34 is owned by digp_tag 100(enow)
Row8: Yes, since entity_tag 4 is owned by 100(enow
I guess i have to join dg.cept_tag and a.cept_tag, but it is not working.....
Can somebody understand this and help...
Thanks
RamQL> select * from ecev;
entity_Tag
7
8
9
0
1
2
3
4
5
6
SQL> select * from dg;
DIGP_TAG CEPT_TAG
600 1
700 1
800 1
900 1
100 1
200 1
500 1
75 2
SQL> select * from enow;
ENTITY_CODE ENTITY_TAG DIGP_TAG
TARGET_DA CEPT_TAG
EXT 7
600 26-MAY-07 1
8 700
26-MAY-07 1
EXT 9
800 26-MAY-07 1
10 800
22-APR-76 1
EXT 1
100 20-OCT-06 1
2 200
20-OCT-06 1
EXT 3
500 20-OCT-06 1
4 100
20-OCT-06 1
EXT 5
100 20-OCT-06 1
6 80
20-OCT-06 1
EXT 1
75 2
L> select * from tk;
TK_TAG DIGP_TAG NARRATIVE DUE_DATE
CEPT_TAG
35 90 raj 27-MAY-07 1
36 900 kkd 27-MAY-07 1
37 100 kim 28-MAY-07 1
30 100 ram 23-MAY-07 1
31 100 kish 23-MAY-07 1
32 200 mar 23-MAY-07 1
33 100 gy 23-MAY-07 1
34 100 mm 27-MAY-07 1
8 rows selected.
For the following query
1 select
2 d.ecev_tag ecev_tag,
3 a.digp_tag entity_owner ,
4 c.digp_tag task_owner,
5 c.tk_tag task_tag,
6 c.narrative
7 from enow a,
8 entl b,
9 tk c,
10 ecev d
11 where ( a.DIGP_TAG=100 or c.digp_tag=100)
12 and a.entity_tag=b.entity_tag(+)
13 and b.tk_tag=c.tk_tag(+)
14* and a.entity_tag=d.entity_tag
SQL> select * from entl;
TK_TAG ENTITY_TAG
35 5
36 10
30 1
31 1
32 2
33 3
34 3
sult:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG
NARRATIVE
5 100 90
35 raj row1
100 100 30
ram row2
75 100
30 ram row31 100 100
31 kish row4
75 100
31 kish row5
3 500 100
33 gy row6
500 100 34
mm row7
100 row8
1: yes, since entity_tag 5 is owned by digp_tag 100
(enow)
Row2: yes, since entity_tag 1 is owned by digp_tag
100 (enow)
Row3: NO, since entity_tag 1 is owned by digp_tag 75,
which in turn is in cept_tag 2, since the passed
digp_tag is 100 and it just belongs to cept_tag 1 we
should not be getting this row.
Row4: Yes, since tk_tag 31 is owned by digp_tag 100
(tk)
Row5 NO, since entity_tag 1 is owned by digp_tag 75,
which in turn is in cept_tag 2 since the passed
digp_tag is 100 and it just belongs to cept_tag 1 we
should not be getting this row.
Row6: Yes, since tk_tag 33 is owned by digp_tag 100
(enow)
Row7: Yes, since tk_tag 34 is owned by digp_tag
100(enow)
Row8: Yes, since entity_tag 4 is owned by 100(enow
I guess i have to join dg.cept_tag and a.cept_tag,
but it is not working.....
Can somebody understand this and help...
Thanks
Ram
Result:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG NARRATIVE
5 100 90 35 raj row1
1 100 100 30 ram row2
1 75 100 30 ram row3
1 100 100 31 kish row4
1 75 100 31 kish row5
3 500 100 33 gy row6
3 500 100 34 mm row7
4 100 row8 -
Query to get the data of all the columns in a table except any one column
Can anyone please tell how to write a query to get the data of all the columns in a table except one particular column..
For Example:
Let us consider the EMP table.,
From this table except the column comm all the remaining columns of the table should be listed
For this we can write a query like this..
Select empno, ename, job, mgr, sal, hiredate, deptno from emp;
Just to avoid only one column, I mentioned all the remaining ( 7 ) columns of the table in the query..
As the EMP table consists only 8 columns, it doesn't seem much difficult to mention all the columns in the query,
but if a table have 100 columns in the table, then do we have to mention all the columns in the query..?
Is there any other way of writing the query to get the required result..?
Thanks..Your best best it to just list all the columns. Any other method will just cause more headaches and complicated code.
If you really need to list all the columns for a table because you don't want to type them, just use something like...
SQL> ed
Wrote file afiedt.buf
1 select trim(',' from sys_connect_by_path(column_name,',')) as columns
2 from (select column_name, row_number() over (order by column_id) as column_id
3 from user_tab_cols
4 where column_name not in ('COMM')
5 and table_name = 'EMP'
6 )
7 where connect_by_isleaf = 1
8 connect by column_id = prior column_id + 1
9* start with column_id = 1
SQL> /
COLUMNS
EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO
SQL> -
Help in query to get the max(date)
Hi I have query like below and based on the query I get the following results,
SELECT a.UsageId,a.product,ProductDate
FROM dbo.table1 a
JOIN dbo.table2 b ON a.SID= b.SID
JOIN dbo.table3 c ON b.CID = c.CID
UsageId Product UsageDate
1 Yellow 2014-01-01
2 Yellow 2014-01-02
3 Yellow 2014-01-03
4 Yellow 2014-01-04
5 Red 2014-01-01
6 Red 2014-01-02
7 Blue 2014-01-03
8 Blue
2014-01-04
Now I want to add a new column which gives me the Max(UsageDate) of the column Prdouct last Usage.
UsageId Product UsageDate Max(UsageDate)
1 Yellow
2014-01-01 2014-01-04
2 Yellow
2014-01-02 2014-01-04
3 Yellow
2014-01-03 2014-01-04
4 Yellow
2014-01-04 2014-01-04
5 Red 2014-01-01 2014-01-02
6 Red 2014-01-02 2014-01-02
7 Blue
2014-01-03 2014-01-04
8 Blue
2014-01-04 2014-01-04Simply use:
SELECT a.UsageId,a.product,ProductDate, MAX(ProductDate) OVER (PARTITION BY a.ProductID) as [Latest Product Usage Date]
FROM dbo.table1 a
JOIN dbo.table2 b ON a.SID= b.SID
JOIN dbo.table3 c ON b.CID = c.CID
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
How to get the Overall result and Avg in Query
Hi
I am facing a problem to find Overall result and Avg for the keyfigure.
Here is the scenario.
I have a fiscalperiod ,qty in query column and material in row, when user enters the fiscalperiod(004.2006 to 006.2006)
the output should come as
0406 0506 0606 Avg
M1 10 20 40 35
M2 20 40 30 45
res 30 60 70
i can able to get the overall result not avg,
if i change the properities of keyfigure 'Calicuate Result as 'Average of all values'',then i am loosing the overall result.
eitherway i can able to get one result,not both.
anybody can help.
Thanks
MadhuYou have 2 key figures and you have put Material in the ROWS.
Remove Material from ROWS and instead use 0FISCYEAR in the row selection.
You can create 12 Key figures for each month and use either Filer or Free Characteristic using 0CALMONTH to restrict the month for the selection Variable.
For the Key Figures use "Calculate Single Value as" Average.
Create another formula as KF1KF2....+KF12 to get the sum of average.
Regs
Gopi
Assign points if it helps... -
Spatial Query to get the coodinates only
Hi,
I define an attribute called "geometry" in TILE table.
For normal query (to get the tileId), I do the following (an example for illustration):
SELECT tileId FROM tile
WHERE SDO_RELATE(geometry, MDSYS.SDO_GEOMETRY(2003, 8307, NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 1),
MDSYS.SDO_ORDINATE_ARRAY(50,10, 70,10, 70,50, 50,50, 50,10)), 'mask=COVERS+CONTAINS+OVERLAPBDYINTERSECT+EQUAL querytype=WINDOW') = 'TRUE'
ORDER BY tileid;
If I do a query on geometry, I will get something like (select geometry from tile):
SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(60, 60, 80, 60, 80, 80, 60, 80, 60, 60))
How can I just get the result of (60, 60, 80, 60, 80, 80, 60, 80, 60, 60) ?
Thanks for your advice!
Message was edited by:
eecowThis should get you the results you need.
select tileid, gv.x, gv.y from tile, table(sdo_util.getvertices(geom)) gv where sdo_relate etc etc etc
Cheers,
David -
RQL Query to get the specific range of product items from product catalog.
Hi All,
I need to do the batch wise query to product catalog.
For that i have use Query builder but that is giving me repeated items, now i wanted to use RQL using rqlStatement.
Please help me in solving the issue.
Query which i have used using QueryBuilder.
RepositoryView productView = productRepo.getView("product");
QueryBuilder productBuilder = productView.getQueryBuilder();
Query productQuery = productBuilder.createUnconstrainedQuery();
RepositoryItems[] productItems = productView.executeQuery(productQuery,startIndex,endIndex);
Can anybody help me in writing RQL Query to get the specific range of product items from product catalog.Hi Shakuntala,
There is no executeQuery method defined in RqlStatement Interface, which will accept index for output result.
So As far as I know, what u are trying to achieve is not possible with RQL statements OOTB way.U can consider range of results based on some condition from Repository items.
Please let me know if u find any way to implement it.
Above Query builder should always return different ids if range is not overlapping with previous range.
Please verify that repeated items ids are same or different,
Quoting from API docs:
RepositoryItem[] executeQuery(Query pQuery,
int pStartingIndex,
int pEndingIndex)
throws RepositoryException
Executes the given query and returns an array of matching RepositoryItems, which are contained within a total potential result set. For example used if one wanted to retrieve elements 50-60 from a query which could return 100 elements.
Regards,
Nitin. -
I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen. I've rebooted, I've reinstalled several times and get the same result. Two days wasted and I can't use my computer!!
I don't know if you've already resolved your problem, but I had the same thing, it took me 6 hours to fix it. I had the exact same as you, installed the update and then it went to a white screen. After trying start up holding down cmmd r or holding down the alt key to try to install it again, nothing worked, same result every time. Then an angel came to me here somewhere but I can't find it now to thank him. Start in safe mode, press shift once you hear the start up chime and hold it down until you hear it again. Installation completion box came up and it was working. turn off computer and start up again normally and all is well. Except my final cut pro x doesn't work with it, have to update that now too. same as when I updated to mavericks.
Hope this helps. -
I am trying to get into my Game Center app but every time I tap on the app it opens too a blank white screen. I have tried several times to reset my phone but I get the same result.
Hello there Sweebs44,
It sounds like you are tapping the Game Center app to open it, but the screen is blank. I recommend signing out of your account:
Go to Settings > Game Center, where you can:
Sign out (tap your Apple ID)
From: iPhone User Guide
http://help.apple.com/iphone/7/#/iph6c493cac
Then close all the running apps:
iOS: Force an app to close
http://support.apple.com/kb/ht5137
Double-click the Home button.
Swipe left or right until you have located the app you wish to close.
Swipe the app up to close it.
When you have done that restart the phone sign back into your account and try again:
iOS: Turning off and on (restarting) and resetting
http://support.apple.com/kb/ht1430
Thank you for using Apple Support Communities.
Take care,
Sterling -
I am trying to download and album off ITUNES but when I get to the billing site and attempt to purchase it, it gives me a message saying "Your Session has timed out." It gives me no other option that to try again and I just keep getting the same results. Anyone have any ideas on what I can do?
Hi, Kenny.
Thank you for visiting Apple Support Communities.
There are a couple things that I would recommend trying. Try closing all open applications and power cycle the device. Next, go through the section labeled Troubleshoot issues on an iPhone, iPad, or iPod touch in the second article below. If the issue persists, try completely signing out of the iTunes Store on the iOS device and sign back in. Be sure to test downloading an application after each step.
iOS: Force an app to close
http://support.apple.com/kb/ht5137
Can't connect to the iTunes Store
http://support.apple.com/kb/ts1368
iOS: Changing the signed-in iTunes Store Apple ID account
http://support.apple.com/kb/ht1311
Cheers,
Jason H. -
How to modify the query to get the output in a single row
Hi All,
Below is the query i have written it works fine
select DISTINCT right(left(CTACCT,13),4) AS LocationNum,
tODS_GLBalance.FiscalYearId AS FiscalYearId,
tODS_GLBalance.FiscalMonthOfYearId AS FiscalMonthOfYearId,
--tods_GLMetadata.Metric,
Case when
tods_GLMetadata.Metric = 'Gross Margin'
Then SUM(Balance)
Else 0
END AS GrossMargin,
Case when
tods_GLMetadata.Metric = 'Occupancy'
Then SUM(Balance)
Else 0
END AS Occupancy,
Case when
tods_GLMetadata.Metric = 'Payroll Dollars'
Then SUM(Balance)
Else 0
END AS Payroll,
Case when
tods_GLMetadata.Metric = 'CF Sales'
Then SUM(Balance)
Else 0
END AS OperatingSales,
Case when
tods_GLMetadata.Metric = 'Operations'
Then SUM(Balance)
Else 0
END AS OperatingExpenses
-- 0 as payroll
from ods.[JJill].[tODS_GLBalance]
inner join ods.Staging.tODS_INF_GLPCT ON tODS_GLBalance.PageNum = tODS_INF_GLPCT.CTPAGE
inner join ods.JJill.tods_GLMetadata ON tods_GLMetadata.AcctDescription = tODS_INF_GLPCT.CTDESC
where
(tODS_GLBalance.FiscalYearId = 2012) and
(tODS_GLBalance.FiscalMonthOfYearId = 2) and
(right(left(CTACCT,13),4)= 3020)
group by
right(left(CTACCT,13),4),
tODS_GLBalance.FiscalYearId,
tODS_GLBalance.FiscalMonthOfYearId,
tods_GLMetadata.Metric
This is the sample output,
LocationNum FiscalYearId FiscalMonthOfYearId GrossMargin Occupancy Payroll OperatingSales OperatingExpenses
3020 2012 2 -112477.00 0.00 0.00 0.00 0.00
3020 2012 2 0.00 0.00 0.00 -158288.94 0.00
3020 2012 2 0.00 0.00 0.00 0.00 5625.44
3020 2012 2 0.00 0.00 24185.79 0.00 0.00
3020 2012 2 0.00 31075.53 0.00 0.00 0.00
But, i am expecting the output to be something like this
LocationNum FiscalYearId FiscalMonthOfYearId GrossMargin Occupancy Payroll OperatingSales OperatingExpenses
3020 2012 2 -112477.00 31075.53 24185.79 -158288.94 5625.44
Can someone please help me with changing my query to get the desired output?
Please let me know if you have any questions.
ThanksTry this:
SELECT DISTINCT
RIGHT(LEFT(CTACCT,13),4) AS LocationNum, tODS_GLBalance.FiscalYearId AS FiscalYearId, tODS_GLBalance.FiscalMonthOfYearId AS FiscalMonthOfYearId,
SUM(CASE WHEN tods_GLMetadata.Metric = 'Gross Margin' THEN Balance ELSE 0 END ) AS GrossMargin,
SUM(CASE WHEN tods_GLMetadata.Metric = 'Occupancy' THEN Balance ELSE 0 END ) AS Occupancy,
SUM(CASE WHEN tods_GLMetadata.Metric = 'Payroll Dollars' THEN Balance ELSE 0 END ) AS Payroll,
SUM(CASE WHEN tods_GLMetadata.Metric = 'CF Sales' THEN Balance ELSE 0 END ) AS OperatingSales,
SUM(CASE WHEN tods_GLMetadata.Metric = 'Operations' THEN Balance ELSE 0 END ) AS OperatingExpenses
FROM ods.[JJill].[tODS_GLBalance]
INNER JOIN ods.Staging.tODS_INF_GLPCT
ON tODS_GLBalance.PageNum = tODS_INF_GLPCT.CTPAGE
INNER JOIN ods.JJill.tods_GLMetadata
ON tods_GLMetadata.AcctDescription = tODS_INF_GLPCT.CTDESC
WHERE tODS_GLBalance.FiscalYearId = 2012
AND tODS_GLBalance.FiscalMonthOfYearId = 2
AND RIGHT(LEFT(CTACCT,13),4) = 3020
GROUP BY right(left(CTACCT,13),4), tODS_GLBalance.FiscalYearId, tODS_GLBalance.FiscalMonthOfYearId, tods_GLMetadata.Metric -
My iphone 6 connects to the car via bluetooth, the music works good, but the phone calls does not work. It looks like it is working but doesn't. I have tried in my Hyundai Sonata and a Dodge Dart rent car and get the same results. I updated the last 8.0.2. It worked the first day i had the phone, and then i updated to Ios 8.0.2 and it quit working.
Now when i get in the car, it acts like it is connected and makes the same call it was on after syncing to bluetooth, but it really isn't on a call. This is happening on both cars.
Does anyone know if this is the phone and i need to take it to Apple or if there is an issue that Apple is working on getting a fix for?
My son in law has the exact same phone as me, we both got the on 10/6, he had a Dodge Dart and his is working via bluetooth.
Someone HELP please, as i consider this a safety issue by not having my calls go to bluetooth.We had the same problem, but figure out the solution.
You MUST have at least 1 song added to your ITUNE! After you add a free song, then everything else should work as normal!
Hope this helps! -
Do not seem to be able to backup iPad via iTunes on to my PC.
Message after connecting is "iTunes was unable to load class information from Sync Services, Reconnect or try later"
Have tried that but get the same result.
Remedies I've tried are:
wait and try again
reboot
reload iTunes
NB hp is a relatively new machine and has previously backed up quite happily.
Can anyone assist?RHoodnkt-
Try rebooting the iPad. Hold down both the Home and Sleep buttons for several seconds until the Apple logo appears. Ignore the "Slide to power off" arrow. It takes a minute or two to restart.
Also be sure your iPad battery is not completely discharged.
Fred -
How to get the fixed result in a DES/CBC mode with fixed input data and fix
How to get the fixed result in a DES/CBC mode with fixed input data and fixed key. Below is my program , I tried to get the checksum of the DESInputData with the DESKeyData, but each time the result is different.
below is my code:
byte[] DESKeyData = {(byte)0x01 ,(byte)0x01 ,(byte)0x01 ,(byte)0x01, (byte)0x01 ,(byte)0x01 ,(byte)0x01 ,(byte)0x01 };
byte[] DESInputData = {(byte)0x31 ,(byte)0x31 ,(byte)0x31 ,(byte)0x31,(byte)0x31 ,(byte)0x31 ,(byte)0x31 ,(byte)0x31 };
SecretKeySpec skey = new SecretKeySpec( DESKeyData, "DES" );
Cipher cipher = Cipher.getInstance("DES/CBC/NoPadding");
cipher.init( Cipher.ENCRYPT_MODE, skey );
byte[] result = cipher.doFinal( DESInputData );Use class javax.crypto.spec.IvParameterSpec to specify IV for CBC mode cipher:
// Create CBC-mode triple-DES cipher.
Cipher c = Cipher.getInstance("DESede/CBC/PKCS5Padding");
// Specify IV.
IvParameterSpec iv = new IvParameterSpec(new byte[] { (byte)0x01, (byte)0x23, (byte)0x45, (byte)0x67, (byte)0x89, (byte)0xAB, (byte)0xCD, (byte)0xEF });
// Initialize cipher with proper IV.
c.init(Cipher.ENCRYPT_MODE, yourKey, iv);
// Encrypt and decrypt should work ok now.
For more info about cryptography, search the Internet for IntroToCrypto.pdf from mr. Phil Zimmerman. This document is also part of PGP (http://www.pgp.com).
An excellent book is 'Applied Cryptography' from Bruce Schneier (http://www.counterpane.com/applied.html).
Regards,
Ronald Maas
Maybe you are looking for
-
JPA and JSF - Problem persisting object
Hi all. I'm having some trouble with JPA, persisting an object to a MySQL table. Let's say I have a simple bean, Message: package my.package import java.io.Serializable; import javax.persistence.Id; import javax.persistence.Entity; import javax.persi
-
Why does my iPad flicker then go black?
When using my iPad all of a sudden it started flickering then the screen went black, after about 5-10 minutes I could use it again.
-
Hallmark Card Studio keeps quitting when I try to view a card Why?
Why does my Hallmark Card Studio quit when I try to view a card? It had always work well till now.
-
Which NI product is suitable for me?
Hello All! I want to have an RF tuning time <= 10 us for both Transmission and reception. Which NI product can be suitable for me if i want a setup like HOST (host.vi) --> FPGA(fpga.vi) --> DAC --> RF board (RF oscillators etc) ? Is any of NI RF boar
-
Setting a ringtone for Blocker Caller/Unknown calls
Most people want to block calls from unknown sources. However I often receive overseas calls where the Caller ID is not sent or from a TravelSim service. My iphone 4S is SILENT when then these calls are incoming which means I miss them if I don't hap