Other than NVL easier way to get the records?
I have data like below. Trying to get the unique lines for toy and the child. i.e.I just want to see the lines with fireld_name = toy for a unique event and field_name = kid for the same event that has multiple lines? I know WHAT NVL is a way to do it, but any other method?
client eventid fieldname
123 2345 toy
123 2356 toy
123 2356 kid
123 2462 toy
123 2589 toy
123 2589 kid
The result i want to see
123 2345 toy
123 2356 kid
123 2589 kid
user11961230 wrote:
I have data like below. Trying to get the unique lines for toy and the child. i.e.
I just want to see the lines with fireld_name = toy for a unique event and field_name = kid for the same event that has multiple lines?
What happens if multiple all lines have fieldname = 'toy', or other values outside of the child?
I know WHAT NVL is a way to do it, but any other method?
Assuming that 'toy' and 'kid' are the only possible values for fieldname, you can do something like this:
SELECT client
, eventid
, MIN (fieldname) AS min_fieldname
FROM table_x
GROUP BY client
, eventid
;
However, it is not really solid programming. It relies on there are only 2 values, and 'kid' just happens to come before 'toy' by alphabetical order. A better solution would allow all values and is not in alphabetical order, like this:
WITH got_r_num AS
(
SELECT client
, eventid
, fieldname
, ROW_NUMBER () OVER ( PARTITION BY client
, eventid
ORDER BY CASE
WHEN fieldname = 'kid'
THEN 1
WHEN fieldname = 'toy'
THEN 2
ELSE 3
END
) AS r_num
FROM table_x
)
SELECT client
, eventid
, fieldname
FROM got_r_num
WHERE r_num = 1
;
If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.
Published by: Frank Kulash, October 25, 2012 11:20
Added ROW_NUMBER solution
Tags: Database
Similar Questions
-
Y at - it an easy way to get the sql code that is sent in the query UPDATE
I have a request to UPDATE abbreviated for readability. Is there an easy way to get the sql code that is sent? I use get this info for sql select in the display of debugging in cfeclipse but not for the UPDATE.
< cfquery debug = "" name = "q" datasource = "#datasource #" > "
UPDATE [BookingSystem]. [dbo]. [tbTrades]
SET
[Status] = #MATCHED_STATUS #.
WHEREclientID = < cfqueryparam value = "" #arguments.clientID # "cfsqltype ="cf_sql_integer"> AND"
< / cfquery >It might pay to read the docs for
- http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_17.html#1102316 - focusing on the RESULT parameter. Read also about debugging in CF: http://livedocs.adobe.com/coldfusion/8/htmldocs/Debug_01.html
--
Adam
-
is there an easy way to get the number of months in a year in a date range?
Hi, experts, I am a newbie.
are there any easy ways to get the number of months in a year in a date range?
I would like to write a user-defined function.
the input parameters are startdate, enddate, year
the output is a number, not a month.
for example, case 1
StartDate = 01032009 (DDMMYYYY)
end date = 28022010 (DDMMYYYY)
If the year 2009, the output is 10
If the year = 2010, the output is 2
case 2:
StartDate = 10032009 (DDMMYYYY)
end date = 15032010 (DDMMYYYY)
If the year 2009, the output is 10
If the year = 2010, the output is 3
Thank you very much!Hello
You can (also) try this:
SQL> with s as ( 2 ------------ Sample data ------------- 3 select to_date('01032009','ddmmyyyy') startdt, to_date('28022010','ddmmyyyy') enddt, 2009 yr from dual 4 union all 5 select to_date('01032009','ddmmyyyy') startdt, to_date('28022010','ddmmyyyy') enddt, 2010 yr from dual 6 union all 7 select to_date('10032009','ddmmyyyy') startdt, to_date('15032010','ddmmyyyy') enddt, 2009 yr from dual 8 union all 9 select to_date('10032009','ddmmyyyy') startdt, to_date('15032010','ddmmyyyy') enddt, 2010 yr from dual 10 ------------ Sample data ------------- 11 ) 12 select startdt, enddt, yr, 13 months_between( 14 least(trunc(to_date(yr+1,'yyyy'),'year') , add_months(trunc(enddt,'month'),1)) 15 , greatest(trunc(to_date(yr,'yyyy'),'year') , trunc(startdt,'month')) 16 ) nbmonths 17 from s; STARTDT ENDDT YR NBMONTHS ---------- ---------- ---------- ---------- 01/03/2009 28/02/2010 2009 10 01/03/2009 28/02/2010 2010 2 10/03/2009 15/03/2010 2009 10 10/03/2009 15/03/2010 2010 3
It's pretty simple. (no connection with, without functions SQL only integrated multicast, etc...)
-
easy way to get the size of a filling?
I have a program that uses a movieClip and draw a shape on it with beginFill, moveTo, lineTo, of of curveTo and endFill. Then, the user can resize and reform this form by dragging and pulling it off.
Is there an easy way to get the surface of the shape as the number of pixels that have been filled? Or I have to calculate what it based on points.
TIAWelcome to the forums. Here's a thread fairly new all about this topic.
Check that out and post if you have any questions.
-
An easy way to get the IP address of a VMware Player running?
Hey guys, need some help to get the IP address of a VMware Player running in windows & linux. An easy way? I search on google. I saw someone said how to limit the selection of the IP address, but this isn't what I want. I want to get the IP address of a VMware Player running in windows & linux. Thank you.
Hi Badboy,
Welcome to the forums.
VMware Player has no IP address, but the guest inside the VM systems have not one.
If your virtual machines based on the internal DHCP server of the player, for example if they are bridge now or NAT network, then on Windows, you should find information useful in the %ALLUSERSPROFILE%\Application Data\VMware\vmnetdhcp.leases. There is such a file on Linux.
Good luck.
Concerning
Franck
-
Is there an easy way to get the previous record in the Apex?
I'm new to APEX/Oracle, but have a lot of expierence as a mainframe programmer and some experience with SQL.
I have been instructed by my boss to create a set of pages in an application like this.
Page 1: Select an employee name and go to Page 2.
Page 2: View employee biography information.
Add a 'Next employee' button and a button "Previous employee" who picks the previous employees respectively biography info.
Essentially, he wants a query with information biography of each employee with an employee selected on page 1, used as pointer to start.
I built successfully "select the name of an employee on page 1" and "show its info on page 2" with a query that returns a single record.
What I can not know is how to get a next and previous button for the next or previous record in a record multi query, using the initially selected employee as intial pointer.
Is their an easy way to build this using functionailty of integrated APEX, or will it require programming to reach this requirement?Just realized that I didn't fully answer your question. According to the number of employees, you can create a collection to contain all the information and who travels with buttons. Or you could include a calculation to transmit the current employee, previous and next to your second page using the standard apex_application.gf01... GFN see the creation process to get the id of current line
Keep smiling,
Bob R -
I need a way to quickly get the data from the path for an SVG. In GIMP, they have a menu option "edit > to path" that returns the data to trace for the chosen path. Super convenient.
Right now I am:
- Design of my work (icons)
- Make a compound path of the work
- Economy in SVG
- Open source SVG in text editor
- Copy the contents of d = «...» »
Any thoughts on a quick way to get this data from illustrator?
Instead of save on the svg have you tried just choose your icon, copy (Ctrl + C) and then go to your text editor and paste it (Ctrl + V), this should then give you the same result as if you were out saving... ?
-
Taché product key
HelloI try to install vista on my laptop but a letter of the key is not visible, all the other parts are very well including the serial code, is there another way to get the key of the other information? The laptop currently has non-OS I've tried to reinstall.
Thank you
Scott
Product keys are bit-agnostic - they don't care if it's 32-bit or 64-bit.
However, cannot legally use the recovery disk from one computer to a different constructor machine - as other licenses are not properly paid..
There is nothing nonetheless to try all possible variations on the absence of character (there are only 25, after all the
) Other than that, your best option is to contact the manufacturer and order a set of recovery disc for the machine. I do no download available for Vista with SP2 - but you can download Vista with SP1 and create the disc.
http://www.heidoc.NET/Joomla/technology-science/Microsoft/57-Windows-Vista-direct-download-links
-
IIOMetadataNode is there an easy way to get all the items?
Y at - it an easy way to get all elements with no recursion to a depth of level in the XML getAsTree IIOMetadataNode ("formatname") document and make the images of type jpeg with EXIF metadata (when its present on the image) who return to the IIOMetadataNode?You can call getChildNodes() on the node returned by getAsTree(). The returned NodeList will contain children with a depth of level.
The EXIF data will be be summarised into a byte array [] under a sequence of 'unknown' marker with a value of 225 marker.
/**Returns the EXIF information from the given metadata if present. The * metadata is assumed to be in
javax_imageio_jpeg_image_1.0
* format. If the EXIF information were not present, then null is recuperer.* / public static ubyte [] getEXIF (IIOMetadata meta) {//javax_imageio_jpeg_image_1.0 //-->markerSequence //--->unknown (attribute: 'MarkerTag' val: 225 (for exif)) root IIOMetadataNode = (IIOMetadataNode) meta.getAsTree ('javax_imageio_jpeg_image_1.0');} IIOMetadataNode markerSeq = root.getElementsByTagName("markerSequence").item (0) (IIOMetadataNode); Notorious NodeList = markerSeq.getElementsByTagName ("unknown"); for (int i = 0; i)< unkowns.getlength();="" i++)="" {="" iiometadatanode="" marker="(IIOMetadataNode)" unkowns.item(i);="" if("225".equals(marker.getattribute("markertag")))="" {="" return="" (byte[])="" marker.getuserobject();="" }="" }="" return="" null;="">You must use a TIFFImageReader to analyze the table of byte [] being the TIFF metadata EXIF metadata.
-
First of all, I am a user of Adobe software for 20 years now. I love the adobe range. I want to just clarify.
Question... Template Files - y at - it an easy way to update the files related to a model, and download them (put) at the same time?
Its been bothering me since I started using Dreamwever 10 years now, when you use template files to create small, who later turn wholesale websites. Whenever I update a template file I have to find each file in the files Panel, then download them. When I navigate through a lot of directories to find it can get a lot of time and boring. Whey cant be just a button that does it? See the attached file.
Is there a way to do this? Any help would be appreciated.
Thank you very much
Andy
The sync tool should do what you want (second "circular arrows" icon in the files window).
Who checks your files against the files of the current server and download all that is changed. By default, is also download any file from the server which is more recent than your local files at the same time, but you can set it to 'Put the latest files remotely' rather than 'get and put newer files' and you should be good to go.
-
I found some ways to get the path of the file, but I am defeated by pulling the list from that. the function of the path get gives me the path as "Macintosh Users:: Documents: extractedb.txt (myUsername).
What I can't understand is how to get a dialog box to display a list that represents the content in the text file, I need to change the contents of the text file, I need the box to show me what I chose and I want to save my selection as a single string.
e '.example of extractedb.txt information:
* has a random number of emails as well *.
I want this is to pull those emails from the text file and turn them into a list so I can get to be a selection in my dialog box.
Any help would be great = D
Assuming you have a text file with your example e-mail addresses, the following AppleScript will read this file in a list (mf_List) and then use this list as input to choose among the list. Because multiple selection is allowed (control button), the output is sent to a list (sel_addr). We check if the Cancel button was pressed by testing for false and if this condition is met, we the script error. Based on a single or multiple list item content of the list, display accordingly.
game of mf to ((path to the folder as text) & "mail_list.txt")
the value mf_List to {}
the value sel_addr to {}
the value mf_List to paragraphs of (read file mf)
the value sel_addr to (choose from the list mf_List with title ¬
('Mail list' with multiple selections allowed without empty selection allowed)
If sel_addr is equal to false then
Error number-128
return
end if
If length of sel_addr is equal to 1 then
sel_addr display dialog box as text
on the other
the value Point to the text of TID to AppleScript delimiters
the value Point text in AppleScript return delimiters
display the dialog box elements of sel_addr in the text
the value Text of point AppleScript delimiters to TID
end if
return
-
Is the another way to get the download from the support section
Is there another way to get the download from the support section?
Because the download speed is very slow. For example, in the new version of the value-added packaging and its 116 MB big need. A normal download time would be approximately 5-10 minutes. But when I download from Toshiba I need 2 to 6 hours. Not good for a company that manufactures laptops and high-performance computers.
And the worst thing is that the connection is reset after a few hours... so I'll never get the update.
Does anyone know help?
Gruss
ThomasUnfortunately, he has no other way to get the Toshiba drivers from the European pilot of Toshiba page.
You are right at this moment that the file transfer is too long.
I get about 10-19KO/s. That s is really very slow.
Maybe the server is overloaded who knows I hope this will be resolved in the next time.Best regards
-
change my mp3 music does, nt come out as I thought and I so do CD fashion old way and burn.when I have made a set of mp3 music library, they were all dated 06/01/16.
now I want to know if there is an easier way to get rid of all the mp3 songs to the format of my library.i been ve music delete songs one by one. If there is a way to chat online would be helpful.some times that I don, t understand what you mean by changing the files and .i m worried that i, m going to lose all my music again.
Yes, open itunes and right-click on the menu where the artist, Album, etc., and then scroll down the menu until you find 'Type' remember to widen the column, and then select the name until all MP3 files are grouped, then select all and delete them.
This is the menu that I speak to you, do a right click on it and Type search
f
-
Easy way to locate the function used on the diagram by name?
Is there an easy way to locate the functions used in the diagram under the name of the generic function?
I have user appears somewhat to the user on my diagram functions to help me debug a difficult sequence of agross events live multiple now that it works, I want to go back and disable most of these postings. Most of them went up to now within the layers a little structure and is not easy to find.
So is there an easy way to get a list of where these functions are used so that I can quickly go and edit them?
I find the function is with the display hierarchy that does just what I need.
Thank you.
-
Is there an easy way to create "the mouse on the text, to display the image" without coding it? I want an image to appear only when you move to a line of text. I found the code for it but I want to find an easier way. I'm creating a home page with a list of text links. I want to design as well as in the overview of one of the text links, a corresponding image is displayed to the right of the page. I also need a default image to rest all the time unless one of the other links text is hovered over. Thank you!
Try to use a Widget for Composition in the Adobe Muse Widgets Panel.
I would like to start with a blank publication.
Place your text in the button area.
Place your image in the display area.
Maybe you are looking for
-
If 'save passwords for the site' is unavailable, how can I to use?
This option is gray, but I want Firefox to save my passwords. How can I make available?
-
I just bought the HP notebook 15-r211na and cannot install the network drivers. Initially, the network drivers do not appear to be installed on the laptop as when I went to the device, under 'Network adapters' Manager, the only thing that he was 'Rea
-
deskjet3630: what instant ink begin to charge
Hello I recently bought an HP printer and it fits in the scheme of the ink instant and I was just wondering when will I begin to pay for it? This is when I install sent containers of ink? or as soon as I signed the printer?
-
I just bought the software and downloaded, but the trail version still appears on the pictures. How can I do that, go away?
-
Received phone call from a man named Thomson. He said he was with Windows in the United States and Florida. Was given the phone number of 315-506-4544. Asking for help with problems with my computer detected by Windows. He said that I was riskin