Help with order/group by (beginner)
Hi.
Im trying to learn SQL developer in school and now I really got a problem.
I wont be able to talk to my teacher for a couple of days and Im want to do this at home, so
I can paste my code and describe my problem.
select ko.ordnr as ordnr, max(sum(a.pris * o.antal)) as summa
from kund k, kundorder ko, orderrad o, artikel a
where k.knr = ko.knr
and ko.ordnr = o.ordnr
and o.artnr = a.artnr;
This is in some swedish, but the main thing is that I need to get the maximum price out of
the order that is the most expensive. But then I need "group by" because its nested and I dont know how to do it.
If I just write "group by ordnr" I get - 00918. 00000 - "column ambiguously defined", which I dont understand.
I hope you understood my explanation and hope you can help me!
Thanks in advance!
Hej, och välkommen till forumet!
961354 wrote:
Warren: Do you want me to post the tables and data, and the expected result for you? Maybe it will be easier for you to help then?Yes, it always helps if you post a little sample data, and the results that you want from that data. Explain how you get those results from that data.
Always say which version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ {message:id=9360002}
If you can illustrate your problem using commonly available tables, such as those in the scott schema, then you don't have to post any sample data; just the results you want and the explanation.
Let's use the scott.emp table, which contains this data:
SELECT deptno, sal
FROM scott.emp
ORDER BY deptno, sal
DEPTNO SAL
10 1300
10 2450
10 5000
20 800
20 1100
20 2975
20 3000
20 3000
30 950
30 1250
30 1250
30 1500
30 1600
30 2850If you wanted to find out what the highest total sal for any one department was, and which department had that total, you could do it this way:
SELECT MAX (deptno) KEEP (DENSE_RANK LAST ORDER BY SUM (sal))
AS d
, MAX (SUM (sal)) AS s
FROM scott.emp
GROUP BY deptno
;Output:
` D S
20 10875Here's what happens when you nest aggregate fucntions (such as "MAX (SUM (...)))"). First, all the inner aggregates are computed, using the GROUP BY clause, so it's as if Oracle was running this query:
SELECT deptno
, SUM (sal) AS total_sal
FROM scott.emp
GROUP BY deptno
ORDER BY total_sal
;and getting these results:
` DEPTNO TOTAL_SAL
10 8750
30 9400
20 10875Then the outer aggregate functions are applied to that result set. The final result set, when you nest aggregate functions, always has exactly 1 row. Notice that if you had a 3-row table like this, and you said
SELECT deptno
, MAX (total_sal)
FROM table_x;you would get an error, because deptno is the the SELECT clause, but it's not an aggregate, or a GROUP BY expression.
Until you post your tables, I can't test it, but I think this is what you're trying to do.
select MAX (ko.ordnr) as ordnr -- ***** Added MAX here *****
, max(sum(a.pris * o.antal)) as summa
from kund k, kundorder ko, orderrad o, artikel a
where k.knr = ko.knr
and ko.ordnr = o.ordnr
and o.artnr = a.artnr
group by ko.ordnr;ko.ordnr is a GROUP BY expression, but the GROUP BY only applies to the first pass, when the inner aggregates are computed. That's why you can use ko.ordnr by itself in the SELECT clause.
Similar Messages
-
I had to put my computer by together without migration or time machine I NEED help with order of the files?
Hi, where are these other files exactly?
-
Can anyone help with ordering prints for Shutterfly? I keep getting to step 4 (payment type) and then it just goes to blank page and nothing happens.
Thanks for your help, I am new to all of this. I think it was my edited pics that were the problem, they were to big of files, I had to go and save them as a new file as a jpeg and then went to shutterfly and downloaded from there. I never could get it to work from Photoshop Elem.
Date: Thu, 9 May 2013 00:51:58 -0700
From: [email protected]
To: [email protected]
Subject: Help with ordering prints
Re: Help with ordering prints
created by vsh07 in Photoshop Elements - View the full discussion
Looks like some problem! Just try the following steps. They worked for me: 1. Go to shutterfly website (www.shutterfly.com) and log into your account.2. In My Account Section> Billing Information, add your Credit Card details and Save.3. Logout from your account and open Photoshop Elements application to order prints.4. Now,on step4 (payment type),your Credit Card details will appear magically Let me know if this solution works for you. It can be of some help to other members too.
Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5304432#5304432
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5304432#5304432
To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5304432#5304432. In the Actions box on the right, click the Stop Email Notifications link.
Start a new discussion in Photoshop Elements by email or at Adobe Community
For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746. -
Test Data:
CREATE TABLE "TEST_GMU"
( "PZINSKEY" VARCHAR2(255) NOT NULL ENABLE,
"PXCREATEDATETIME" DATE,
"PXURGENCYASSIGN" NUMBER(18,0),
"WORK_PXURGENCYWORK" NUMBER(18,0),
"MASTERACCNTFIRMCUSTID" VARCHAR2(255 CHAR)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12858!AMADVISORSERVICESFLOW','16-JUL-13 15.55.57.000000 PM',0,40,'2531215');
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12859!AMADVISORSERVICESFLOW','16-JUL-13 15.01.22.000000 PM',0,40,'742254777');
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12860!AMADVISORSERVICESFLOW','16-JUL-13 15.01.23.000000 PM',0,40,'2531215');
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12861!AMADVISORSERVICESFLOW','16-JUL-13 15.03.55.000000 PM',0,40,'2568091');
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12862!AMADVISORSERVICESFLOW','16-JUL-13 15.03.56.000000 PM',0,40,'742254777');
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12863!AMADVISORSERVICESFLOW','16-JUL-13 15.03.57.000000 PM',0,40,'2568091');
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12864!AMADVISORSERVICESFLOW','16-JUL-13 15.06.29.000000 PM',0,40,'742254777');
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12865!AMADVISORSERVICESFLOW','16-JUL-13 15.06.31.000000 PM',0,40,'2568091');
insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12866!AMADVISORSERVICESFLOW','16-JUL-13 15.06.32.000000 PM',0,40,'742254777');
The output required is like below
1. AM-12859 BXYZAB CO. 742254777 07/16/2013 15:01:21
2. AM-12862 BXYZAB CO. 742254777 07/16/2013 15:03:56
3. AM-12864 BXYZAB CO. 742254777 07/16/2013 15:06:27
4. AM-12866 BXYZAB CO. 742254777 07/16/2013 15:06:31
5. AM-12858 WHIJKL CO. 2531215 07/16/2013 15:01:16 The values of this timestamp is actually '16-JUL-13 15.55.57 in datbase
6. AM-12860 WHIJKL CO. 2531215 07/16/2013 15:01:22
7. AM-12861 SIJKLM CO. 2568091 07/16/2013 15:03:54
8. AM-12863 SIJKLM CO. 2568091 07/16/2013 15:03:56
9. AM-12865 SIJKLM CO. 2568091 07/16/2013 15:06:30
I could work this out till below:
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12859!AMADVISORSERVICESFLOW 7/16/2013 3:01:22 PM 0 40 742254777
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12862!AMADVISORSERVICESFLOW 7/16/2013 3:03:56 PM 0 40 742254777
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12864!AMADVISORSERVICESFLOW 7/16/2013 3:06:29 PM 0 40 742254777
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12866!AMADVISORSERVICESFLOW 7/16/2013 3:06:32 PM 0 40 742254777
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12861!AMADVISORSERVICESFLOW 7/16/2013 3:03:55 PM 0 40 2568091
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12863!AMADVISORSERVICESFLOW 7/16/2013 3:03:57 PM 0 40 2568091
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12865!AMADVISORSERVICESFLOW 7/16/2013 3:06:31 PM 0 40 2568091
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12860!AMADVISORSERVICESFLOW 7/16/2013 3:01:23 PM 0 40 2531215
ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12858!AMADVISORSERVICESFLOW 7/16/2013 3:55:57 PM 0 40 2531215
with order by masteraccntfirmcustid desc ,pxcreatedatetime
But one of the developer told me masteraccntfirmcustid should be asc
This resultset is supposed to be ordered by
order by masteraccntfirmcustid ,pxurgencyassign desc NULLS LAST ,work_pxurgencywork desc NULLS LAST,pxcreatedatetime
in the test data I have been given pxurgencyassign and work_pxurgencywork is same for all the records
Could you please help?
Thanks,
swapnilthe results of the query are not matching the data in the table. like ....
1. BXYZAB CO.
2. BXYZAB CO.
3. BXYZAB CO. -
I have the following table
EX_ID
EX_NAME
EX_SURNAME
EX_FLAG
1
TOM
JONES
Y
1
JIM
SLIM
N
1
BO
SELECTA
Y
2
AIRES
BEARS
N
2
JIM
DAVIES
Y
3
PAUL
BALL
N
3
YOU
KNOW
N
I need to create a query that only displays one of the ex_id’s, it doesn’t matter which one. When the query has been run it will look like below:
EX_ID
EX_NAME
EX_SURNAME
EX_FLAG
1
TOM
JONES
Y
2
AIRES
BEARS
N
3
YOU
KNOW
N
Can anyone help with this query?SELECT * FROM
SELECT *,ROW_NUMBER () OVER (PARTITION BY ex_id ORDER BY (SELECT 0))
FROM tbl
) AS Der WHERE rn=1
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Need help with order booking tutorial
Hi
I am new to OracleFusion.
Started Learning By practising OrderBooking tutorial for 10g.
I am practising parellel branching in the tutorial .
I ve invoked Rapid distributors service in branch 1 of the flow activity.
and
i ve invoked Select manufacturing service in branch 2 of flow activity.
I ve deployed order booking service,rapid distributed service,select manufacturing service in the server.
Select manufacturing service is an asynchronous service .for this service to be complete it requires user to manually set price for the item ordered.
So I accesed SelectManufacturinUI in browser as instructed in book.The problem is tht it is directing me to login page where User id and password should be submitted.
In the tutorial no info is given regarding login details fot this page.Hence i am not able to set price for order.
So the Select manufacturing service is not completed ..hence i am not able to move further in the tutorial..
Kindly help with this..if any one has faced same prblm
thanksHi
I got the answer. Just posting it so that it helps someone
User id i tried : jcooper
password : Bpel console startup password -
Help with order by and group by together
Hi: I have a table with severity and devicename as two fields. I want a query which returns a list to include the records in the following order: Devicename with the highest severity at the top but all records should be grouped by devicename irrespective of the severity. Essentially I want the devicename record with the highest severity value at the top. Below is an example
Ticket1, DEVA, Severity:2
Ticket2, DEVA, Severity:4
Ticket3, DEVB, Severity:1
Ticket4, DEVB, Severity:8,
Ticket5, DEVC, Severity 3
Query's result should be as follows
Ticket3, DEVB
Ticket4, DEVB
Ticket1, DEVA
Ticket2, DEVA
Ticket5, DEVC
I have tried the following and it doesn't work.
Select a.devicename, b.severity
from (
select DEVICENAME,MIN(SEVERITY) from USERINCISUMMSTATUS group by DEVICENAME ORDER by MIN(SEVERITY) DESC) a,
USERINCISUMMSTATUS b
where a.devicename = b.devicename;TIA
RayNot a grouping but an ordering;
SQL> with t as (
select 1 ticket, 'DEVA' devicename, 2 severity from dual union all
select 2, 'DEVA', 4 from dual union all
select 3, 'DEVB', 1 from dual union all
select 4, 'DEVB', 8 from dual union all
select 5, 'DEVC', 3 from dual)
select ticket,
devicename,
severity
from t
order by max(severity) over (partition by devicename) desc,
devicename,
severity
TICKET DEVI SEVERITY
3 DEVB 1
4 DEVB 8
1 DEVA 2
2 DEVA 4
5 DEVC 3 -
Help with processing groups of records in database
Ok i'm at work right now trying to finish up a project for my class and what it is is a basic class to process an inner join sql statement generated table from access and order it by the student id in order to group each student together. I have written the sql statement and logic to access the database and return the array of row objects to the command line so i know it is grouping and returning info properly. I have written the conditional if statement to get the gradePoints for A = 4, B = 3, C = 2, D = 1, and F = 0 in a class method (KEEP IN MIND THE GENERATED TABLE CONSISTS OF SID, NAME, COURSE#, COURSETITLE, AND LETTERGRADE) now I just need to process each group of students individually and calculate their overall gpa's. Here in lies the problem. I imagine i need to define current student variables as like
currentID = s[0].getStudentID();
currentName = s[0].getStudentName();
then loop through the values of the array with something like
for(int j = 0; j < s; ++j)
if(s[j].getStudentID != currentID)
Process the grade records for the group Then reset the
current student to the next in line with another variable
assignment like
currentID = s[j].getStudentID();
currentName = s[j].getStudentName();
}(end of if)
Process the row object for the student created by this loop and then add it to the output string
} (end of for loop)
Ok so where i need help is the logic to process the grade records for the individual groups and then processing the row object. We haven't gone over anything like this in class and it is the last thing on my list to to do so any help would be appreciated. Also, if you think i'm an idiot keep it to yourself please it's not fun for people who really need help and really would like to know for future reference how to do something to be belittled. Thanks again
Matt
Message was edited by:
djmd02sorry i guess is hopuld explain this better...I know
sql relatively well and the sql statement for my
query string is rediculously long with two inner
joins and what it returns is the sid, name,
coursenumber, coursename, and lettergrade So if you know SQL so well, why haven't you created a ViEW using this "ridiculously long" query and made your life easier?
Two inner joins? Nothing extraordinary about that.
this query
generated table is then used to populate an array of
objects for each entry in the table. They are already
put in order depending on sid by the sql statement
(for example)
11111 matt deClercq 3380 intro to java A
11111 matt deClercq 3382 database management A
11112 john doe 3380 intro to java A>
and so on. The problem i am having is within the for
loop to detect the end of each student and process
their grades for each class and calculate the gpa for
the whole group of grades that that student has.SQL is a declarative language, not procedural. If you're "looping", it suggests to me that you're pulling all that data into the middle tier and doing the calculation in Java.
I'm suggesting that there's a perfectly good way to do this calculation in SQL without using your ridiculous query. You might be better served if you try and figure out what that is.
Hope this makes things a little more clear and makes
me look a little bit more intelligent than i seemStop worrying about what people think and concentrate on your problem. You're a student. It's unlikely that you're going to appear to be on the level of Bill Joy at this point in your career. I'd be a lot more impressed if you'd stop whining about how people perceive you.
% -
PSE 8 - Help with Editing Group Layers
I am working with some templates right now that are apparently set up in Grouped layers. I've looked into it, and the best result I can find is that I hav eto "simplify" the group in order to be able to edit the layers. That doesn't seem to allow me to edit the layers individually, though.
If layers are "grouped," does that mean I can't edit the layers? Please Help!
Thank you!Here is an action someone made just for that.
http://www.elementsvillage.com/forums/showthread.php?t=48026&highlight=layer+groups
This action opens the layer groups by deleting the layer group (set) while leaving
the layers inside.
So the layers will no longer be in layer groups (sets), but at least you will be able to see
what's inside the layer groups and edit those layers.
MTSTUNER -
Help with excel grouped data and sorting to keep data intact
I have a master spreadsheet with lots of data. I am trying to grouped the data based on physical address/city, add the values and once done sort it by valuation based on descending order by valuation but my data keep messing up.
So in Row 1/col A: Address 1; Col B City: XXX; Col C: Valuation $$$
Row 2/col A: Address 1; Col B City: XXX; Col C: Vauation $$$
Row 3/col A: Address 2; COl B City: YYY; Col C: Valuation $$$
SO I sort by city and in ROw 1/2 same city with same address, I grouped it. THen I created a new row below Row 3 and add up the grouped data (i.e. ROw 1 and 2). I go through the entire list to finalize the grouped locations.
But when I am done and I sort by Valuation, all my data messed up coz I created a new row with addition of grouped location valuation and the formula gets messed up.
Any one with ideas please help. My deadline for this project is just a week away and I am freaking out.
THanks in advance.it seems upload a sample is more clearly about the required.
KR -
[10g] Need help with order by clause in hierarchical query
I have the following sample data:
CREATE TABLE bill_test1
( parent_part CHAR(25)
, child_part CHAR(25)
, line_nbr NUMBER(5)
, qty_per NUMBER(9,5)
INSERT INTO bill_test1 VALUES ('ABC-1','ABC-10',100,1);
INSERT INTO bill_test1 VALUES ('ABC-1','ABC-20',200,2);
INSERT INTO bill_test1 VALUES ('ABC-1','ABC-30',300,3);
INSERT INTO bill_test1 VALUES ('ABC-1','HARDWARE-1',401,10);
INSERT INTO bill_test1 VALUES ('ABC-1','HARDWARE-2',402,5);
INSERT INTO bill_test1 VALUES ('ABC-10','ABC-155',100,2);
INSERT INTO bill_test1 VALUES ('ABC-10','HARDWARE-1',200,1);
INSERT INTO bill_test1 VALUES ('ABC-155','RAW-2',100,4.8);
INSERT INTO bill_test1 VALUES ('ABC-155','HARDWARE-3',200,3);
INSERT INTO bill_test1 VALUES ('ABC-20','RAW-1',100,10.2);
INSERT INTO bill_test1 VALUES ('ABC-30','RAW-3',100,3);And the query below gives me exactly what I want, in the order I want it. However, I am wondering if there is a way to get this order without creating the SEQ column, since I don't need it in my results
SELECT part_nbr
, parent_part
, child_part
FROM (
SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr
, b.parent_part
, b.child_part
, SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq
FROM bill_test1 b
, dual
CONNECT BY parent_part = PRIOR child_part
WHERE part_nbr = 'ABC-1'
ORDER BY seq
Results of above query, except with SEQ included in SELECT (just to show what I'm sorting off of):
PART_NBR PARENT_PART CHILD_PART SEQ
ABC-1 ABC-1 ABC-10 100
ABC-1 ABC-10 ABC-155 100 100
ABC-1 ABC-155 RAW-2 100 100 100
ABC-1 ABC-155 HARDWARE-3 100 100 200
ABC-1 ABC-10 HARDWARE-1 100 200
ABC-1 ABC-1 ABC-20 200
ABC-1 ABC-20 RAW-1 200 100
ABC-1 ABC-1 ABC-30 300
ABC-1 ABC-30 RAW-3 300 100
ABC-1 ABC-1 HARDWARE-1 401
ABC-1 ABC-1 HARDWARE-2 402Hi,
As long as there's only one root, you can say ORDER SIBLINGS BY, but you can't do that in a sub-query (well, you can, but usually there's no point in doing it in a sub-query). If the CONNECT BY is being done in a sub-query, there is no guarantee that the main query will preserve the hierarchical order that the sub-query provides.
The query you posted doesn't require a suib-query, so you can say:
SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr
, b.parent_part
, b.child_part
--, SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq
FROM bill_test1 b
WHERE CONNECT_BY_ROOT b.parent_part = 'ABC-1'
CONNECT BY parent_part = PRIOR child_part
ORDER SIBLINGS BY b.line_nbr
;I said the query you posted doesn't require a sub-query. It also doesn't require dual, so I suspect what you posted is a simplification of what you're really doing, and that may need a sub-query. In particular, if you intend to GROUP BY part_nbr, then you need the sub-query. We can repeat the CONNECT_BY_ROOT expression in the WHERE clause (or, now that I think about it, use a START WITH clause instead of WHERE), but, for some reason, we can't use CONNECT_BY_ROOT in a GROUP BY clause; we need to compute CONNECT_BY_ROOT in a sub-query, give it a name (like part_nbr), and GROUP BY that column in a super-query.
This assumes that there is only one root node. ORDER SIBLINGS BY means just that: children of a common parent will appear in order, but the root nodes, who have no parents, will not necessarily be in order.
Here's what I meant by using START WITH instead of WHERE:
SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr
, b.parent_part
, b.child_part
--, SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq
FROM bill_test1 b
START WITH b.parent_part = 'ABC-1'
CONNECT BY parent_part = PRIOR child_part
ORDER SIBLINGS BY b.line_nbr
;This should be much more efficient, because it narrows down the results before you waste time getting their descendants.
Using a START WITH clause here is analagous to me sending you an e-mail, saying "Come to a meeting a my office at 3:00."
Using a WHERE clause here is analagous to me sending an e-mail to everyone in the company, saying "Come to a meeting a my office at 3:00", and then, as people get here, telling everyone except you that they can go back.
ORDER SIBLINGS BY was introduced in Oracle 9.
Edited by: Frank Kulash on Dec 9, 2010 2:39 PM
Added version with START WITH clause -
Need Help with Photomerge Group Shot
I'm trying to photomerge a group shot and having trouble with it. The person I'm trying to cut out of the source photo gets plopped into the middle of the final photo and I can't line her up with in final shot. Is there a way I can relocate the section that gets pasted into the final photo? I'm also have trouble with aligning the photo--how do you know what points to select in the fist and second photo? I've been playing with it, but the photos get terribly distorted.
Appreciate any help. I was expecting Photoshop Elements 10 to make this easy, and so far, it hasn't impressed me.
Thanks,
TerriOK, here we go:
Make a selection (in the main image) of the area you want to be replaced:
Open your other image, select the head to use, and copy it to the Clipboard. (I simply used another one of the heads in this photo.)
Back in the main image, use Edit...Paste into Selection:
Change to the Move Tool and move the pasted-in image to where it looks best:
You already know what to do next with the Clone Tool. (Probably have to use Layer...Flatten Image to get rid of all the selections and layers so the Clone Tool can do its work....)
Ken
P.S., Looks like you did a real good job with the girl on the left.
P.P.S., The image is a bit too small for us to do precision work (but it's OK for this example). Next time you can try something about 2 or 3 times larger and see if the forum software accepts it. -
Hi,
I have written the following query:
select customer.cust_id as "Customer ID"
,customer.cust_area_code as "Customer Area Code"
,customer.cust_number as "Customer Number"
,sum(calls.elapsed_minutes) as "Total Call Length (Mins)"
,sum(calls.elapsed_minutes*calls.rate) as "Total Cost Of Calls £"
from
(select cust_id
,floor((end_date_time-start_date_time)*1440) as elapsed_minutes
,chrg_per_minute as rate
from phonecall
) calls
,customer
where customer.cust_id = calls.cust_id
group by customer.cust_id, customer.cust_area_code, customer.cust_number, calls.cust_id
order by customer.cust_id asc
However on the last line instead of ordering it by customer.cust_id i would like to order it by "total cost of calls" however when ever i try and order it by this i get an error.
Do i need to assign it to another var before i use it in an order clause?
ThanksI wrote about [url http://forums.oracle.com/forums/click.jspa?searchID=5648765&messageID=1739843]the order of evaluating on select statement recently.
On the logical, select statement is evaluated in th following order.
[1-1] from
[1-2] on (joining)
[2-1] where (joining)
[2-2] start with, connect by
[2-3] where (excluding joining)
[3] group by
[4] having
[5] select
[6] union, union all, minus, intersect
[7] order by
The alias can be referred predefined in this order, but cannot be referred same level or post-defined. In subquery, this principle is affected as same also.
The table alias and/or the column alias on [1-1] 'from' can be referred all level excluding [1-1], but cannot be referred in inline view (subquery) on [1-1] 'from'.
select xxx from tab1 a1,(select xxx2 from tab2 a2 where a2.xxx=a1.xxx) -- No Good (This is same level)
select a1,a2 from (select xxx a1, xxx2 a2 from tab1) -- Good
select * from (select xxx a1, xxx2 a2 from tab1) -- Good, * explode to a1,a2
The column alias on [5] 'select' only can be referred on [7] 'order by'.
select xxx a1, xxx2 a2,count(*) from tab1 group by a2 -- No Good (post defined)
select xxx a1, xxx2 a2,count(*) from tab1 order by a2 -- Good
The naming rule of alias must accord with [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements008.htm#i27561]Schema Object Names and Qualifiers.
So, the alias enclosed by double quotation mark becomes case sensitive.
In additional, in order-by-clause, we can specified column number on select-clause.
select empno,ename,sal from scott.emp order by 3; -- this means order by sal -
I want to select the same column name from 2 tables, combine them, and give them a certain order but I am getting:
ORA-01785: ORDER BY item must be the number of a SELECT-list expression
select a from table1 where a = 'TYY000007'
union all
select a from table2 where a = 'TXXXXXXXX'
order by TRANSLATE(a, 'ABCDEFGHIJKMNOPQRSUVWXYTL0123456789','0123456789ABCDEFGHIJKMNOPQRSUVWXYTL') DESC;
I know the TRANSLATE works because it will work with just 1 table query and I've used it in other queries.
Please help.Hi,
Noramally, you can ORDER BY something that is not in the SELECT clause.
In a UNION query, you can't.
if you want to ORDER BY d046d (or something derived from it), then you have to include d046d in the SELECT clause. To avoid displaying it, you can do the UNION in a sub-query, like this:
WITH union_results AS
select a, d046d from table1 where a = 'TYY000007' -- This is easy to do without a UNION,
union all -- but that's not the point
select a, d046d from table2 where a = 'TXXXXXXXX'
SELECT a
FROM union_results
ORDER BY TRANSLATE ( d046d
, 'ABCDEFGHIJKMNOPQRSUVWXYTL0123456789'
, '0123456789ABCDEFGHIJKMNOPQRSUVWXYTL'
) DESC
; -
Need help with ORDER BY clause
Hey,
I have a table:
Name: Year:
Eagle 2000
Tiger 2001
Eagle 2002
Lion 2006
Lion 1999
Fox 1991
Lion 1995
I need a query which will return in such order:
Name: Year: Position:
Eagle 2000 1
Eagle 2002 2
Fox 1991 1
Lion 1995 1
Lion 1999 2
Lion 2006 3
Tiger 2001 1
So, of course to get Name and Year in this order is quite easy:
select Name, Year from Animals order by Name, Year;
but how about Position, is there a way to count it with SQL?
any help is welcome,
SilvestrasSQL> with rt as
2 (select 'Eagle' nm, 2000 yr from dual union all
3 select 'Tiger', 2001 from dual union all
4 select 'eagle', 2002 from dual union all
5 select 'Lion', 2006 from dual union all
6 select 'Lion', 1999 from dual union all
7 select 'Fox', 1991 from dual union all
8 select 'Lion', 1995 from dual)
9 select nm,yr,row_number() over(partition by (nm) order by nm,yr) position from rt;
NM YR POSITION
Eagle 2000 1
Fox 1991 1
Lion 1995 1
Lion 1999 2
Lion 2006 3
Tiger 2001 1
eagle 2002 1
7 rows selected.
SQL> with rt as
2 (select 'Eagle' nm, 2000 yr from dual union all
3 select 'Tiger', 2001 from dual union all
4 select 'eagle', 2002 from dual union all
5 select 'Lion', 2006 from dual union all
6 select 'Lion', 1999 from dual union all
7 select 'Fox', 1991 from dual union all
8 select 'Lion', 1995 from dual)
9 select nm,yr,row_number() over(partition by lower(nm) order by nm,yr) position from rt;
NM YR POSITION
Eagle 2000 1
eagle 2002 2
Fox 1991 1
Lion 1995 1
Lion 1999 2
Lion 2006 3
Tiger 2001 1
7 rows selected.
SQL>
Maybe you are looking for
-
BW Error: GET_BUSINESS_SYSTEM_ERROR
Hello, I am getting the following error BW Error 1: GET_BUSINESS_SYSTEM_ERROR: An error occured when determining the business sytem NO_BUSINESS_SYSTEM BW Error 2: No data returned by XI I am getting no errors in sxmb_moni & while doing message moni
-
Blue vertical streak on papers hp color laserjet cm1015 mfp
Recently my printer has printed 2 blue vertical streaks on documents I print. I checked the supply levels and there is still about 45% of the ink left for all the toner colors. I tried using the cleaning mode, but it didn't help the problem. If so
-
Ipod in washer....
After my 4g ipod went through the washing machine I did not plug it in or charge it I opened her up and let her dry (waranty over by 1 year) I left it open for about 2 days, put it back together and it worked. It now functions perfect other than when
-
Security settings change from Acrobat Pro to Reader
I have set the Security Method in Acrobat Pro to allow "commenting, filling in form fields, and signing existing signature fields." But when I send the PDF file my customer who opens the document using Adobe Reader, commenting is not allowed. Why i
-
Like to enable column in matrix
Sorry, to disrespect my previous message; Now: I want to know like to enable one column in matrix by form Landed Costs in folder Costs, the column is Amount. I try to use this: mtLandedCosts.Columns.Item(3).Editable = true; but the same column still