Simple query... but couldn't get it
CREATE TABLE person_del
DNO VARCHAR2(5),
place VARCHAR2(10),
Got VARCHAR2(10)
commit;
insert into person_del values('1','home','Y')
insert into person_del values('1','office','N')
insert into person_del values('1','other','Y')
insert into person_del values('2','office','Y')
insert into person_del values('3', 'home', 'N')
insert into person_del values('3', 'office', 'Y')
insert into person_del values('4', 'other', 'N')
insert into person_del values('5', 'home', 'Y')
insert into person_del values('6', 'home', 'N')
insert into person_del values('6', 'office', 'N')
insert into person_del values('7', 'home', 'Y')
insert into person_del values('7', 'office', 'Y')
commit;
select * from person_del
select dno,place,got,
case when got='Y' then 'Y'
else null
end as "won"
from person_del
where place in ('home','office')
I ran the above query, but the result is not what I wanted
The requirement is as described below:
List Y in a new column "won" for those dno's who achieved the place - either home or office
If GOT=Y for place home and GOT=N for place office, then display only that column where GOT=Y
If GOT=N for place home and GOT=Y for place office, then display only that column where GOT=Y
If both are N then list any one of the column
If both are Y then list any one fo the column
The place other is not taken into account
The output should be dno and won column
I know this is simple...but i couldn't get it and I need it in few mins
Can someone help me on this using CASE statement or something that isn't tricky to understand ASAP ?
Basically, the output for this one should be as follows:
dno won
1 Y
2 Y
3 Y
5 Y
6 N
7 Y
Guess you'll have to fiddle a bit with the possible combinations:
SQL> select dno
2 , got won
3 from ( select dno
4 , got
5 , row_number() over (partition by dno, got order by dno, got desc) cnt
6 , count(*) over (partition by dno order by dno) cnt2
7 from person_del t
8 where t.place in ('home', 'office')
9 )
10 where ( case
11 when got = 'Y' and cnt = 1 then 1
12 when got = 'N' and cnt = cnt2 then 1
13 end
14 ) = 1
15 order by to_number(dno);
DNO WON
1 Y
2 Y
3 Y
5 Y
6 N
7 Y
10 N
7 rows selected.I went for a CASE approach in order to show you that you can use it in your predicate (WHERE-clause) as well.
Solomon's solution is more concise, elegant and problably more performant as well ( and a sign for me to stop playing with queries after midnight ;) ).
Similar Messages
-
I have a pc and downloaded a trial version of Adobe Acrobat DC to create pdfs. I have followed the simple instructions but what I get is an entire screen shot saved instead of just my document. The instructions seem so simple. I can't imagine what I am doing wrong. Have project I need to submit today. Please help.
Unfortunately, what you describe isn't a common problem. It is pretty surprising, but hopefully it's a simple as clicking or pressing the wrong thing. So, to find this out we need to know, step by step, at the most basic level, what you click or type EXACTLY and what you see. That should let us get to the cause.
-
i have purchased adobe photoshop element 10 editor today but been having problem downloading.. it says error and problem on verification. Also tried contacting customer support but couldn’t get through? can I still get my money back?
Hi ...
If you have anti virus software installed, you need to disable that in order to download apps.
Apple's policy clearly states that, "all sales are final" > iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
edited by: cs -
Looks like a simple query but need your help
Hello everyone,
I have a simple problem but I can't get over it. Actually, it looks like a simple problem, but I can't do it. So,it's probably not... Anyone can help me with this?
Imagine the following data:
ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS';
SELECT TRUNC(SYSDATE) - TO_DATE('01/01/11', 'DD/MM/RR') FROM dual; -- 564
DROP TABLE runs;
CREATE TABLE runs
start_date DATE,
end_date DATE
-- generate some random data
INSERT INTO runs(start_date)
SELECT TO_DATE('01/01/11', 'DD/MM/RR') + trunc(dbms_random.value(0,564))
FROM dual
CONNECT BY LEVEL <= 10000;
-- still generating sample data
UPDATE runs
SET end_date = start_date + dbms_random.value(0,20000) / 86400; -- 20000 sec is the max
COMMIT; If you execute the previous "script", you'll end up with a table called RUNS with 10.000 records. Each record contains a start date and an end date which is max 20.000 second after the start date.
What I would like to do is a report based on these data.
I need something like this:
(first week of 2011 started on sunday. So I go back to the last monday of 2010)
WEEK_NUMBER AVG_FOR_MONDAY_BY_WEEK CUMULATIVE_AVERAGE_FOR_MONDAYS
Week 1: 26/12/2010 - 01/01/2011 9999 88888
Week 2: 02/01/2011 - 08/01/2011 1111 22222
....For each week, I would like to have the average duration (which is the difference in seconds between end_date and start_date) by day (monday needs to have its average, tuesday, wednesday...too)
And I also need a cumulative average by week and by days (mondays, tuesdays...). This cumulative average needs to be based on all the preceding rows.
Can anyone help me with this query? I'm using Oracle 10g
ThanksHi,
Something along these lines :
alter session set nls_date_language = "english";
with all_data as (
select to_char(start_date, 'IYYYIW') as wk
, to_char(start_date, 'dy') as dy
, (end_date - start_date)*86400 as duration
from runs
week_data as (
select wk
, round(avg(case when dy = 'mon' then duration end)) as avg_mon
, round(avg(case when dy = 'tue' then duration end)) as avg_tue
, round(avg(case when dy = 'wed' then duration end)) as avg_wed
, round(avg(case when dy = 'thu' then duration end)) as avg_thu
, round(avg(case when dy = 'fri' then duration end)) as avg_fri
, round(avg(case when dy = 'sat' then duration end)) as avg_sat
, round(avg(case when dy = 'sun' then duration end)) as avg_sun
from all_data
group by wk
select wk
, avg_mon
, sum(avg_mon) over(order by wk) as cum_avg_mon
, avg_tue
, sum(avg_tue) over(order by wk) as cum_avg_tue
, avg_wed
, sum(avg_wed) over(order by wk) as cum_avg_wed
, avg_thu
, sum(avg_thu) over(order by wk) as cum_avg_thu
from week_data
order by wk;
WK AVG_MON CUM_AVG_MON AVG_TUE CUM_AVG_TUE AVG_WED CUM_AVG_WED AVG_THU CUM_AVG_THU
201052
201101 9836 9836 8737 8737 9088 9088 12167 12167
201102 7639 17475 10319 19056 7391 16479 8036 20203
201103 8275 25750 8883 27939 8525 25004 11682 31885
201104 7029 32779 10850 38789 7360 32364 7617 39502
201105 10292 43071 11421 50210 11141 43505 9469 48971
201106 11612 54683 9762 59972 11464 54969 9517 58488
201107 8645 63328 10206 70178 10124 65093 11917 70405
201108 11466 74794 11678 81856 10839 75932 9587 79992
201109 8745 83539 6803 88659 8963 84895 9496 89488
201110 10443 93982 8104 96763 10314 95209 10908 100396
201111 8183 102165 9467 106230 11495 106704 12040 112436
201112 8575 110740 9207 115437 10338 117042 9561 121997
201113 10273 121013 6268 121705 11288 128330 12335 134332
201114 10176 131189 8561 130266 10367 138697 7983 142315
201115 10587 141776 12073 142339 8528 147225 12271 154586
201116 9393 151169 10761 153100 7901 155126 10020 164606
201117 11459 162628 9471 162571 10136 165262 8188 172794
201118 11946 174574 9997 172568 9367 174629 10475 183269
201119 12869 187443 9848 182416 7692 182321 9632 192901
201120 9675 197118 7408 189824 11646 193967 9614 202515
201121 10742 207860 10302 200126 9208 203175 7543 210058
201122 8083 215943 8323 208449 10045 213220 9498 219556
201123 11838 227781 8820 217269 8804 222024 10485 230041
201124 8748 236529 12143 229412 9684 231708 8402 238443
201125 11504 248033 10586 239998 10073 241781 9573 248016
201126 7289 255322 14241 254239 10100 251881 11843 259859
201127 10855 266177 9980 264219 10320 262201 11023 270882
201128 11004 277181 9975 274194 11609 273810 8945 279827
201129 10488 287669 9402 283596 11985 285795 9481 289308
201130 7338 295007 8963 292559 11982 297777 8177 297485
201131 9778 304785 10024 302583 10732 308509 10749 308234
201132 10360 315145 12577 315160 8643 317152 10001 318235
201133 9845 324990 10416 325576 9996 327148 10548 328783
201134 9540 334530 8138 333714 9401 336549 9093 337876
201135 7000 341530 9920 343634 10370 346919 10937 348813
201136 11307 352837 8889 352523 12339 359258 8491 357304
201137 11785 364622 9146 361669 9232 368490 11023 368327
201138 7857 372479 6784 368453 8502 376992 12558 380885
201139 9842 382321 10616 379069 10435 387427 7848 388733
201140 10578 392899 9402 388471 8806 396233 9927 398660
201141 6711 399610 13015 401486 9934 406167 10011 408671
201142 10088 409698 10380 411866 7836 414003 9205 417876
201143 8132 417830 11772 423638 10792 424795 10834 428710
201144 9921 427751 7454 431092 9551 434346 10754 439464
201145 13196 440947 11600 442692 11303 445649 10455 449919
201146 12022 452969 8996 451688 10221 455870 12567 462486
201147 8965 461934 10068 461756 10607 466477 13486 475972
201148 9483 471417 9264 471020 9601 476078 8685 484657
201149 11738 483155 9000 480020 10284 486362 11263 495920
201150 10338 493493 10237 490257 10357 496719 10984 506904
201151 10777 504270 11138 501395 10543 507262 9840 516744
201152 9881 514151 10692 512087 11432 518694 10122 526866
201201 11089 525240 8077 520164 12391 531085 9649 536515
201202 9871 535111 8326 528490 9449 540534 10551 547066
201203 10625 545736 11609 540099 9626 550160 5795 552861
201204 8856 554592 9679 549778 10722 560882 11064 563925
201205 9379 563971 9943 559721 8409 569291 11656 575581
201206 10843 574814 10070 569791 12162 581453 10764 586345
201207 8424 583238 8484 578275 8382 589835 8716 595061
201208 11159 594397 10415 588690 11459 601294 11317 606378
201209 11264 605661 8244 596934 9682 610976 10192 616570
201210 11514 617175 9322 606256 9101 620077 10571 627141
201211 9348 626523 7501 613757 12297 632374 11170 638311
201212 10523 637046 7605 621362 10348 642722 10068 648379
201213 10411 647457 11686 633048 10212 652934 9574 657953
201214 9394 656851 10526 643574 8521 661455 9829 667782
201215 8994 665845 12256 655830 8243 669698 10592 678374
201216 11491 677336 10939 666769 12846 682544 9708 688082
201217 9737 687073 9611 676380 7244 689788 10943 699025
201218 9024 696097 11286 687666 10033 699821 10314 709339
201219 9851 705948 9851 697517 9159 708980 9917 719256
201220 7785 713733 10490 708007 8534 717514 8528 727784
201221 11107 724840 8197 716204 8926 726440 10834 738618
201222 8093 732933 11853 728057 11697 738137 10081 748699
201223 9371 742304 10796 738853 11068 749205 9904 758603
201224 10600 752904 8487 747340 10838 760043 8009 766612
201225 11090 763994 9595 756935 10736 770779 9387 775999
201226 8234 772228 12759 769694 9119 779898 8422 784421
201227 9738 781966 9383 779077 8978 788876 11635 796056
201228 11687 793653 10302 789379 9459 798335 10608 806664
201229 9245 802898 11290 800669 798335 806664
82 rows selected -
Simple query but for me it is difficult
Hi,
Table:
Aircraft Rec_type Doc_type
A6ERA G PO
A6ERB M PO
A6ERA G RO
A6ERD M SC
A6ERF N MC
A6ERL M RO
A6ERM G EK
Now I want to get all the rows i.e., Select * from table
Condition: REC_TYPE='G' and DOC_TYPE are not equal to 'PO/RO/MC'
We can write the query for separate
i.e., Select * from table where rec_type='G' and (doc_type!='PO' and doc_type!='RO' and doc_type!='MC')
It is correct.
Anybody knows ,we can give all the values(PO,RO,MC) in one fileds
i.e., doc_type!=(PO,RO,MC)
How will I write the query?use 'NOT IN'
Select * from table where rec_type='G' and doc_type NOT IN ('PO','RO','MC'); -
Simple query but it doesn't work
hi, i have 2 schema, that is user1 and user2
i run this query on user1 but it doesn't give any result, but if i run on user2 it does return results. any idea why this happen?
SELECT
STORE_ID,
NVL(STORE_NAME,'-'),
l.INSUPD_TIME
FROM user2.store s, user2.LOG l
WHERE (s.rowid = l.row_id)
AND insupd_time > (SELECT MAX(loading_time)
FROM user2.LOG
WHERE table_name = UPPER('Store'));hi,
in the query u did not specify any table that is present in the schema user 1
try this
SELECT s.STORE_ID, NVL(s.STORE_NAME,'-'),i.INSUPD_TIME
FROM user2.store s, user2.LOG i
WHERE (s.rowid = i.row_id)
AND s.insupd_time > (SELECT MAX(loading_time)
FROM user2.LOG
WHERE table_name = UPPER('Store')
Trinath Somanchi,
Hyderabad. -
Simple query (i can not get logic...help me)
I have 2 tables with equal fields.
Table: A Table: B
No Name No Name
1 Raju 1 Raju
2 Rani 2 Rani
3 Giri 5 Vasu
4 Venu (3 rows)
5 Vasu
(5 rows)
I need Output will be from Table A only.
No Name Flag
1 Raju True
2 Rani True
3 Giri False
4 Venu False
5 Vasu True
Please give a query to get this output.(without union concept i want)
thanks
madhavascott@ORA92> -- test data:
scott@ORA92> select * from a
2 /
NO NAME
1 Raju
2 Raini
3 Giri
4 Venu
5 Vasu
scott@ORA92> select * from b
2 /
NO NAME
1 Raju
2 Rani
5 Vasu
scott@ORA92> -- query:
scott@ORA92> select a.no, a.name,
2 nvl2 (b.no, 'True', 'False') as flag
3 from a, b
4 where a.no = b.no (+)
5 /
NO NAME FLAG
1 Raju True
2 Raini True
3 Giri False
4 Venu False
5 Vasu True
scott@ORA92> spool off -
Simple query but not using index..please help??
I do have this column indexed. Why my query is not using this index?
Any help .
select count(*) from v_dis_sub_har;
SQL>
COUNT(*)
4543289
1 row selected.
SQL>
select vzw_vendor_id , count(*)
from v_dis_sub_har
group by vzw_vendor_id
SQL> 2 3 4
VZW_VENDOR_ID COUNT(*)
200091 908653
200013 908659
200012 908659
200057 908659
200031 908659
5 rows selected.
SQL> SQL>
explain plan for
select
event_seq
from v_dis_sub_har b
where b.VZW_VENDOR_ID='200013'
-- and b.status='P' and b.extract_date is null
SQL> 2 3 4 5 6 7
Explained.
SQL> SQL>
select plan_table_output from table(dbms_xplan.display)
SQL> SQL> 2
PLAN_TABLE_OUTPUT
Plan hash value: 2852398983
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 908K| 7986K| 3132 (16)| 00:00:38 |
|* 1 | TABLE ACCESS FULL| V_DIS_SUB_HAR | 908K| 7986K| 3132 (16)| 00:00:38 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
1 - filter("B"."VZW_VENDOR_ID"=200013)
13 rows selected.
SQL> SQL>You are right Justin. Oracle is not stupid as you may want to say some times when things do not happen according to you. I just created a bitmap index on status field and look what appened. Som times it uses bitmap index and some times it does not. And the reason is clear. Row count by status. 'S' status uses bitmap index where 'P' does not.
Thanks for your help.
select status, count(*)
from v_dis_sub_har
group by status
;SQL> 2 3 4
S COUNT(*)
A 5844982
P 2312759
S 20178
3 rows selected.
SQL>
explain plan for
select
event_seq
from v_dis_sub_har b
where
--b.VZW_VENDOR_ID=200013
-- and
b.status='S'
--and b.extract_date is null
select plan_table_output from table(dbms_xplan.display)
SQL> 2 3 4 5 6 7 8 9 10
Explained.
SQL> SQL> SQL> SQL> 2
PLAN_TABLE_OUTPUT
Plan hash value: 829738689
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| T
ime |
PLAN_TABLE_OUTPUT
| 0 | SELECT STATEMENT | | 20290 | 118K| 2772 (1)| 0
0:00:34 |
| 1 | TABLE ACCESS BY INDEX ROWID | V_DIS_SUB_HAR | 20290 | 118K| 2772 (1)| 0
0:00:34 |
| 2 | BITMAP CONVERSION TO ROWIDS| | | | |
|
|* 3 | BITMAP INDEX SINGLE VALUE | V_DISPATCH_SUBSCRIPTION_NDX2 | | | |
|
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
3 - access("B"."STATUS"='S')
15 rows selected.
SQL> SQL> set line 120
SQL> /
PLAN_TABLE_OUTPUT
Plan hash value: 829738689
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 20290 | 118K| 2772 (1)| 00:00:34 |
| 1 | TABLE ACCESS BY INDEX ROWID | V_DIS_SUB_HAR | 20290 | 118K| 2772 (1)| 00:00:34 |
| 2 | BITMAP CONVERSION TO ROWIDS| | | | | |
|* 3 | BITMAP INDEX SINGLE VALUE | V_DISPATCH_SUBSCRIPTION_NDX2 | | | | |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
3 - access("B"."STATUS"='S')
15 rows selected.
SQL>
explain plan for
select
event_seq
from v_dis_sub_har b
where
--b.VZW_VENDOR_ID=200013
-- and
b.status='P'
--and b.extract_date is null
select plan_table_output from table(dbms_xplan.display)
SQL> 2 3 4 5 6 7 8 9 10
Explained.
SQL> SQL> SQL> SQL> 2
PLAN_TABLE_OUTPUT
Plan hash value: 2852398983
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2325K| 13M| 5784 (18)| 00:01:10 |
|* 1 | TABLE ACCESS FULL| V_DIS_SUB_HAR | 2325K| 13M| 5784 (18)| 00:01:10 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
1 - filter("B"."STATUS"='P')
13 rows selected.
SQL> -
Trying to optimize this simple query
Hi,
I am trying to optimize this simple query but the two methods I am trying actually make things worse.
The original query is:
SELECT customer_number, customer_name
FROM bsc_pdt_account_mv
where rownum <= 100
AND Upper(customer_name) like '%SP%'
AND customer_id IN
SELECT cust_id FROM bsc_pdt_assoc_sales_force_mv
WHERE area_identifier IN (
SELECT area_identifier FROM bsc_pdt_assoc_sales_force_mv
WHERE ad_identifier = '90004918' or rm_identifier = '90004918' or tm_identifier = '90004918'
The result set of this query returns me the first 100 rows in 88 seconds and they are all distinct by default (don't know why they are distinct).
My first attempt was to try to use table joins instead of the IN conditions:
SELECT
distinct -- A: I need to use distinct now
customer_number, customer_name
FROM bsc_pdt_account_mv pdt,
bsc_pdt_assoc_sales_force_mv asf,
SELECT distinct area_identifier FROM bsc_pdt_assoc_sales_force_mv
WHERE ad_identifier = '90004918' or rm_identifier = '90004918' or tm_identifier = '90004918'
) area
where
area.area_identifier = asf.area_identifier
AND asf.cust_id = pdt.customer_id
AND Upper(customer_name) like '%SP%'
AND rownum <= 100 -- B: strange when I comment this out
order by 1
I dont understand two things with this query. First issue, I now need to put in the distinct because the result set is not distinct by default. Second issue (very strange), when I put the rownum condition (<100) I get two rows in 1.5 seconds. If I remove the condition, I get 354 rows (whole result set) in 326 seconds.
My second attempt was to use EXISTS instead of IN:
SELECT
customer_number, customer_name
FROM bsc_pdt_account_mv pdt
where Upper(customer_name) like '%SP%'
AND rownum <= 100
AND EXISTS
select 1 from
bsc_pdt_assoc_sales_force_mv asf,
SELECT distinct area_identifier FROM bsc_pdt_assoc_sales_force_mv
WHERE ad_identifier = '90004918' or rm_identifier = '90004918' or tm_identifier = '90004918'
) area
where
area.area_identifier = asf.area_identifier
AND asf.cust_id = pdt.customer_id
This query returns a similar distinct result set as teh original one but takes pretty much the same time (87 seconds).The query below hangs when run in TOAD or PL/SQL Dev. I noticed there is no rows returned from the inner table for this condition.
SELECT customer_number, customer_name
FROM
bsc_pdt_account_mv pdt_account
where rownum <= 100
AND exists (
SELECT pdt_sales_force.cust_id
FROM bsc_pdt_assoc_sales_force_mv pdt_sales_force
WHERE pdt_account.customer_id = pdt_sales_force.cust_id
AND (pdt_sales_force.rm_identifier = '90007761' or pdt_sales_force.tm_identifier = '90007761') )
ORDER BY customer_name
-- No rows returned by this query
SELECT pdt_sales_force.cust_id
FROM bsc_pdt_assoc_sales_force_mv pdt_sales_force
WHERE pdt_sales_force.rm_identifier = '90007761' or pdt_sales_force.tm_identifier = '90007761' -
What is wrong with this simple query
Hi,
I am writting a simple code just to get the maximum no values from a database table
The query is
ResultSet = stm.executeQuery("SELECT MAX(column_name) FROM Database_table ");
it seems to be a simple one but i am getting the message
column not found
Please answer soonWell, it depends on how your resultset is retrieving the results. If you retrieve by column name, then that's your problem. You need to do something like this:
ResultSet = stm.executeQuery("SELECT MAX(column_name) AS myColumnName FROM Database_table ");
String myResult = ResultSet.getString(myColumnName);Using MAX, COUNT, etc, will return your result with a mangled or no actual column name to retrieve from. Optionally, you can solve your problem by:
ResultSet.getString(1);Michael Bishop -
When I got my ipod I made an account with iTunes right from my ipod.Yesterday, I made a password lock to get into my ipod and I couldn't get into it even though I did the correct one. Now it says"connect to iTunes" BUT I can't because I never registered on the computer. I've tried holding the home and sleep/wake button for 10 sec and then only the home for 5sec and that might have reset it, but it didn't help. If any of you guys know what to do so I can unlock it I would appreciate it VERY much.
If you haven't done so install iTunes on your computer. http://www.apple.com/itunes/
Follow the instructions here: iPhone and iPod touch: Unable to update or restore -
I am using Numbers on my iPhone5 and cannot get the app to do a simple (SUM) calculation. It shows the formula correctly in the cell, but all I get for my long list of numbers to add is 0. How can I get this to work?
Oaky, at least we got that far. Next step is to determine if all those "numbers" are really numbers. Changing the format to "number" doesn't necessarily change the string to a number. The string has to be in the form of a number. Some may appear to you and me as numbers but will not turn into "numbers" when you change the formatting from Text to Number. Unless you've manually formatted the cells to be right justified, one way to tell if it is text or a number is the justification. Text will be justified to the left, numbers will be justified to the right.
Here are some that will remain as strings:
+123
123 with a space after it.
.123 -
Simple SQL, but i get an error?
Here's my code:
<cfquery name="setNote"
datasource="#DS#" dbtype="ODBC"
username="#DSUsername#" password="#DSPassword#"
>
update Notes set note = 'test' where noteid = 1
</cfquery>
Seems simple enough, but I get this:
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
UPDATE statement.
Yeah, I know "Access Sucks.", but this still seems like it
should work, no?
If I do a "select * from notes" and cfdump the results, I see
the data that is there, I just can't update it.
What am I missing here?duplicate post. answered in db access forum.
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
I have been infected by trove adware, I was able to remove it, but I couldn't get default setting of safari and keeping bookmarks, saved passwords, ..etc
There is no need to download anything to solve this problem.
You may have installed the "Trovi," "Conduit," or "SearchProtect" ad-injection malware. Follow the instructions on this Apple Support page to remove it.
Back up all data before making any changes.
Besides the files listed in the linked support article, you may also need to remove these files in the same way:
~/Library/Application Support/Firefox/searchplugins/MyBrand.xml
~/Library/Application Support/Google/Chrome/External Extensions/fjadmdmahkpbhgbmmkiiaanlnlekelmn.json
~/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]
One of the steps in the article is to remove malicious Safari extensions. Do the equivalent in the Chrome and Firefox browsers, if you use either of those. If Safari crashes on launch, skip that step and come back to it after you've done everything else.
If you don't find any of the files or extensions listed, or if removing them doesn't stop the ad injection, then you may have one of the other kinds of adware covered by the support article. Follow the rest of the instructions in the article.
Make sure you don't repeat the mistake that led you to install the malware. Chances are you got it from an Internet cesspit such as "Softonic" or "CNET Download." Never visit either of those sites again. You might also have downloaded it from an ad in a page on some other site. The ad would probably have included a large green button labeled "Download" or "Download Now" in white letters. The button is designed to confuse people who intend to download something else on the same page. If you ever download a file that isn't obviously what you expected, delete it immediately.
"SearchProtect" may be distributed along with two other applications: "MacKeeper," which is a scam, and "ZipCloud," which, if not actually a scam, has a dubious reputation. Ask if you need instructions to remove those items.
In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
Still in System Preferences, open the App Store or Software Update pane and check the box marked
Install system data files and security updates (OS X 10.10 or later)
or
Download updates automatically (OS X 10.9 or earlier)
if it's not already checked. -
I have a MacBook and am running Mac OS X 10.6.8, I thought I couldn't get a virus but a friend recently told me she got one of those stupid link emails from me that I never sent. What can I do?
When a virus infects a Windows PC one of the first things it does is mine the PC's e-mail address book. It will then send out e-mails containing itself to addresses in the address book using another address from the address book as the sending address.
The only way you can tell where the e-mail comes from is to look at the long headers. In Mac Mail View>Message>Long Headers.
So it probably wasn't sent from your Mac but from a PC who has both your addresses in his mail .
Maybe you are looking for
-
How to get rid of freeform input layer
Hey.Somehow i have started getting a gray layer for drawing letters every time i have a text input field.i dont know how to get rid of it permanently.also i can no longer hold down a letter to get a capital letter and the autocorrect doesnt work.help
-
Dear SAPGURUs , i have a quirey regarding j1iex , i can change duty values in J1iex ( in change mode ) but for Bill of Entry ( import - cvd values ) i am unable to change .......As in tab " duty rates " , the check box - calculate excise duties based
-
White Balance settings name "Cloudy" Italian version
Hi, the White Balance "Cloudy" settings italian name is not "Nuvolo" but "Nuvoloso". Nuvolo is a forums slang words, it is non italian!!! Will You modify it?
-
Mac OS X update, what update is the one that includes the Mac App Store.?
help
-
Getting "Name0" should be "Name" from Write Data Channel vi
Can someone please explain this behavior? For some reason I'm getting "0's" apended to the Name string of my Write Data Channel vi. Small write vi sample is attached. thanks for any help Attachments: write[1].vi 316 KB