Put 2 queries together
For an assignment at school I have to write just one SQL query.
These 2 queries work very well but I don't know how to put them together.
Can anyone help me with this?
Thanks!
String query = "SELECT LASTNAME, FIRSTNAME, RESULT, PLACE, YEAR FROM ATHLETE.ATHLETE, ATHLETE.RESULT, ATHLETE.DISCIPLINE, ATHLETE.TOURNAMENT WHERE ATHLETE.DISCIPLINE.DNAME = '400M' AND ATHLETE.RESULT.ANR = ATHLETE.ATHLETE.ANR AND ATHLETE.RESULT.DNR = ATHLETE.DISCIPLINE.DNR AND ATHLETE.RESULT.TNR = ATHLETE.TOURNAMENT.TNR ORDER BY RESULT" ;
String query = "SELECT RESULT FROM (SELECT RESULT, ROW_NUMBER() over (order by RESULT) R FROM ATHLETE.RESULT) WHERE R BETWEEN 1 AND 3" ;
Hi,
I think the string should look like the following:
String query = "SELECT LASTNAME, FIRSTNAME, RESULT, PLACE, YEAR FROM ATHLETE.ATHLETE, ATHLETE.RESULT, ATHLETE.DISCIPLINE, ATHLETE.TOURNAMENT WHERE ATHLETE.DISCIPLINE.DNAME = '400M' AND ATHLETE.RESULT.ANR = ATHLETE.ATHLETE.ANR AND ATHLETE.RESULT.DNR = ATHLETE.DISCIPLINE.DNR AND ATHLETE.RESULT.TNR = ATHLETE.TOURNAMENT.TNR AND ATHLETE.RESULT.RESULT in (SELECT RESULT FROM (SELECT RESULT, ROW_NUMBER() over (order by RESULT) R FROM ATHLETE.RESULT) WHERE R BETWEEN 1 AND 3) ORDER BY RESULT" ;
ps. Please acknowledge that the solution was provided.
Regards, Gerwin
Similar Messages
-
....Need to brush up my tablet design in DPS (did it a few years back), can anyone recommend on the Adobe site tutorials that I can download, with artworks /buttons / actions and put it together?
See this forum post here from Bob. Best place to learn DPS is on Adobe TV http://tv.adobe.com/product/digital-publishing-suite/
If you are specifically looking to learn how to create interactive overlays, go here http://helpx.adobe.com/digital-publishing-suite/help/overview-interactive-overlays.html Watch the videos on "Folio Overlays panel, Part I & Part II" -
Appropritate forum to put queries regarding data archiving
Hi All,
Which one is the appropriate forum to put queries regarding data archiving?
Thanks in advance.
VithalprasadYes you can use this forum, also there is one forum for Data Transfers.
Regards,
Altaf Shaikh -
OBIEE: Link Two Separate Queries Together
Hi,
I am trying to link two separate queries together in BIEE.
I have a query that will give me the sales value in January 2012 (monthly query)
But I would need to use the sales value of January 2012 to help derive the weekly sales value in another query (weekly query).
How would you link up two queries together?
I tried using union but it doesnt seem to be working.
Thanks.
BillHi Billy,
Sure, My pleasure. Here are the basic steps what you could go through.
1. Create an analysis with your Month (January) and Sales.
2. Save this analysis as Report1.
3. Create another analysis with Week and Sales.
4. Create a filter on column:Sales using the option 'Based on Another Analysis'. The analysis editor will provide you an option to browse your other analysis which you want this analysis to be based on and just click on this browse button, and navigate to and select Report1.
5. Once you have selected Report 1 through browse option, you get down in the same pop-up the relationship and use values in column.
So sample entries in this pop-up might look like
Column : Sales
Operator : is based on results of another analysis
Saved Analysis : /My Folder/Report1
Relationship : is equal than
Use values in Column : Sales
6. If you run this analysis, you could get all weekly sales figures which are equal to the january sales figures.
Hope this helps.
Thank you,
Dhar -
EA1 - Code formatting "squishes" multiple queries together
If you have more than 1 query in an SQL Worksheet and you "Format" (CTRL-F7) the query, then it removes all blank lines and bunches all of the queries together.
I would have expected it to leave a blank line after each ";" so that the individual queries can be easily identified.That's great news, thanks. I don't know if maybe I read your post a little wrong, but if I have this code:
1 select * from dual;
2
3 select sysdate from dual;
It currently formats as:
1 select * from dual;
2 select sysdate from dual;
And if I read your post correctly, the new option will format it as:
1
2 select * from dual;
3
4 select sysdate from dual;
Is that correct? I guess what I would really prefer is a blank line "between" any two (or more) SQL statements or PL/SQL blocks, but I'd be quite happy with a blank line "after" each block. Possibly the intended meaning was to have a blank line before each SQL statement, except for the first one. Is that correct?
Greg. -
I have two accounts how do I put them together?
I have two accounts how can i put them together so I have only one?
Currently, it's not possible. All purchases are tied to eack individual account.
-
How to put website together?
I have designed a pretty basic website design and usually just put it together in softwae my webhost had but it is no onger available and I'm wondering how i would put all this together to host.
The Layout Goes This Way
Home Page - - - - - Home Page
Photo Page - - - - - Portrait Page
- - - - - Model Page
- - - - - Wedding Page
- - - - - Event Page
- - - - - Sports Page
- - - - - Product Page
Video Page
Design Page
Info Page
Blog Page
Contact Page
Some Pics of layout:
HOME PAGE PHOTO PAGE(LIST FOR DIFFERENT PHOTO PAGES OPEN)
Model Photo Page
From there with Photo page would just have horizontal scroll to view all images and for Design and Video would just have a Vertical Scroll.
I realize this is probably really basic but I don't have hours of time to actually find a tuturiol on this so if you could help and message me or point me in a direction for tuturiol on what I'm looking for that would be great!
Thanks,
StewPointing you to tutorials that discuss HTML & it's relationship with CSS won't help you much because you won't understand a word of it. If you don't have the discipline & time to learn code and web design basics first, Dreamweaver is not the best tool for you.
As Curtis said, you should probably hire a professional web developer to build your site so you can concentrate on what you do best.
If that's not an option. Then you'll be happier with a consumer-level product such as Adobe MUSE (beta code name) or SiteGrinder . The code isn't terrific but results are adequate for amateurs and hobbyists who don't need a professionally crafted web site.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb -
Cracked my, tried put back together now wont turn on:(:(
Cracked my screen, tried fixing it but ordered the glass w/o a LCD screen, put back together now wont turn on:(:(. What can I do??
Order the correct parts and attempt the repair again.
If you are unable to repair it yourself you will need to take it to a third party repair shop.
Neither Apple nor an Apple authorised dealer will help as you have dismantled the iPhone yourself. In the unlikely event they do help they will charge you for the full repair cost. A third party repairer will be considerably cheaper, assuming you have not damaged it beyond repair. -
Question on "tying" two queries together
I get an error when I run the following code (shown below).
Why can't I "tie" these 2 queries together like this?
Both run fine by themselves and give me good data, I just need to tie them together.
This is for a beginning sql class, so I all I really want is an explanation as to why this is not allowed.
I'm not finding the answer in the book I have.
Any insight for a newb appreciated!
SQL> SELECT order#, isbn, title, SUM(quantity) AS SubTotal
2 FROM orderitems RIGHT OUTER JOIN books USING (isbn)
3 GROUP BY order#, isbn, title
4 ORDER BY order#
5 WHERE (isbn, title) IN
6 (SELECT isbn, title
7 FROM books
8 WHERE retail - cost >
9 (SELECT AVG(SUM(retail - cost))
10 FROM books
11 GROUP BY isbn));
WHERE (isbn, title) IN
ERROR at line 5:
ORA-00933: SQL command not properly endedHi,
When the following clauses are used, they always have to be in this order:
WHERE
GROUP BY
ORDER BY
You can skip any (or all) of these, but when you use them, they have to come in that order.
Move the WHERE-clause (the whole thing, up to, but not including, the semicolon) before the GROUP BY clause. -
I have 4 different color puzzle pieces and I want to put them together in one design how would I do it?
More info please.
Do you have the 4 puzzle pieces in 4 separate files? If that is the case...
1. Create a blank canvas large enough to fit the completed puzzle.
2. Open one of the piece files.
3. Select just the piece (minus the background).
4. Copy the selection to the clipboard (Edit > Copy).
5. Activate the canvas and paste from the clipboard (Edit > Paste). The piece will be placed on a new layer with transparent background.
6. Do the same with the other pieces.
7. Now you can rotate/move the pieces as necessary to fit them together.
If the 4 pieces originally are in the same file you can do similar: select each piece and copy/paste, etc.
If this is not your scenario please clarify. -
hello people,
im need to java, i was wonderig if anyone could
help me out i have some jsp's java script, and ive never
messed with jave before how would i put these scripts together?i need some help if someone is
willing to help me put the thing i have together on
my server ... its called webaim and Silicon Monkey
developed is and i dont have a clue about java cos i have
never messed with it.. and i really want this on my server. -
I have two pictures (face shots of myself and my boyfriend). How do I put the two pictures together as one picture?
One one image, then use File>Place to import as many images as you need.
-
Being new but learning, how do you put the sequences together when your ready to make your DVD?
Hello, and welcome to the Forum!
Tell us more about what you have in mind. What exactly do you mean by +"put the sequences together when your ready to make your DVD?"+ There are a number of things this might mean -
Nesting sequences in FCE
Creating chapters
Distinguishing a 'full-play' movie vs. playing chapter-by-chapter
Exporting from FCE
Importing into iDVD; creating iDVD menus
Something else ... -
Putting songs together as albums
hello
i just upgraded to itunes 7 and there i can subdivide my songlist into showing whole albums to make it more clearly arranged (sorry, badly expressed)
but the program refuses to let appear certain songs in the same album column, even if i rewrite the tags of the files.
so for example i got 3 songs by singer A but one of them appears under "unknown album", the others appear under the album they are actually from. i can change the tag of the other one but it refuses to appear with the others.
how can i group them all together?
with some other artists it just works...
thanksi have checked the info on the files so i am sure that the album info is the same on every song.
Are all the songs from the same album?
A spelling or punctuation mistake, or sometimes a trailing space usually causes this after the artists and/or song name, which fools the iPod into thinking that there are two different artists or songs so you end up with multiple copies. The trailing space is the hardest to spot.
Best way to cure this is to go into iTunes, highlight that artist and/or songs, right click on them and select "get info".
This brings up the multiple song info window. If you see the "artist" field is left blank, then there is a discrepancy with that name.
So to correct this, in the artist or song box retype the name, as you would like it, and then click ok. You should do this even if no mistakes are immediately visible.
Re sync this new artist/song info to your iPod. -
Hi All
I am trying to get a script together to run against a specific OU (our disabled Users OU) to make the process of leavers more automated.
I am trying to achieve the 4 main outcomes below
1. Disable User account
2. Hide from GAL
3. Export users group membership to a file based on SamAccountName
4. Remove users from all groups except domain users
I have some parts of this working from other peoples scripts i have found on the web but need to tie it all together which is proving to be beyond my basic scripting ability
Below is what i have so far, this does disable users / hide from GAL and remove groups however as stated i would really like it to export the group membership to a file before removing them so i have a record should a mistake be made.
$users= get-aduser -Filter {(Enabled -eq "True")} -SearchBase "ou=Disabled Accounts,dc=test2k8,dc=local"
Function RemoveMemberships
param([string]$SAMAccountName)
$user = Get-ADUser $SAMAccountName -properties memberof
$userGroups = $user.memberof
$userGroups | %{get-adgroup $_ | Remove-ADGroupMember -confirm:$false -member $SAMAccountName}
$userGroups = $null
$users | %{RemoveMemberships $_.SAMAccountName}
ForEach ($user in $users)
set-aduser -identity $user.sAMAccountName -Enabled $false -replace @{msExchHideFromAddressLists=$true}
exit
If there is anyone here that can help i would be very grateful
Many Thanks
NickTry this:
$Users = get-aduser -Filter {(Enabled -eq "True")} -SearchBase "ou=DisabledAccounts,dc=test2k8,dc=local"
Function Remove-GroupMembership
[CmdletBinding()]
param
[parameter(ValueFromPipeline=$true)]
$Identity
process
if ($Identity -is [string] -or !$Identity.memberof)
$Identity = Get-ADUser $Identity -properties memberof
Write-Verbose -message $Identity.samAccountname
foreach ($Group in $Identity.memberof)
Write-Verbose $Group
Remove-ADGroupMember $Group -confirm:$false -member $Identity
$Users | Remove-GroupMembership -verbose 4> c:\users\mmcnabb\desktop\groups.txt
forEach ($User in $Users)
set-aduser -identity $user.sAMAccountName -Enabled $false -replace @{msExchHideFromAddressLists=$true}
It uses the verbose stream to redirect the groups out to a text file of your choice. Please note this is untested so please use with caution.
Maybe you are looking for
-
Please help...
-
CRM 7.0 Contact person in order not replicated to R/3
Hello all, I am currently facing issue with contact persons in CRM orders. There are several partners in the CRM order. Standard ones like ship-to party is replicated to R/3; employee roles are also replicated into R/3 within an order; contact person
-
Please clarify the following related to IACOR
Dear Experts, Please clarify the following related to IACOR. 1 For using workflow, IACOR service should be active in ITS? T or F 2 Is sometimes IACOR activation is required to be done prior to publishing a service u2013 T/F Regards, Ramakrishna
-
My imac is very slow. I ran a program and this is what I got. Sorry I do not know what it means. Can someone please help me to speed up mu imac? EtreCheck version: 1.9.11 (43) - report generated 8 June 2014 5:08:20 PM AEST Hardware Information:
-
Elements 10 - "Save for Web" function not working.
No response when clicked. Menu closes. That's all. As far as I know, everything else is fine. Using Win7-Home Prem.