SQL to match a single value in a comma-delimited text field
I have a column that can contain zero, one or more recordIDs (from another table) stored as strings of text delimited by commas (for example, a list). I need to retrieve all the records that match a unique value within this list.For example, if I want to match all values recordID equal 3, and I use... WHERE MyColumn IN ('3'), I get all records that have EXACTLY 3 as the value of MyColumn, but not just any what MyColumn registers whose values include 3, if these are such instances as "3.17" or similar.
Also using the LIKE operator - as WHERE MyColumn LIKE '%3% ' - make me records containing values (35) or 13...
Can I use some kind of list processing ColdFusion speaker to output only the records you want?
Normalize your database so that your data becomes available.
Tags: ColdFusion
Similar Questions
-
Enter several values in the comma-delimited text box
Hello
I have a text box element on my entry page, where to enter specific user name to get the data it is an optional field,
the requirement is now so the user want to type in several user names in the text box element.
Is it possible, and they want to enter usernames separated by commas...
How can I change my code?
Here is the code that I currently have a
select * from DW_RFA_JOBDATA where FINISH_TIME >= :P1_START_DATE and FINISH_TIME < :P1_END_DATE AND ( USER_NAME = :P1_USER OR (USER_NAME = USER_NAME AND :P1_USER is null))
Misspelling in the sql. Try this one
select * from DW_RFA_JOBDATA where FINISH_TIME >= :P1_START_DATE and FINISH_TIME < :P1_END_DATE AND instr(',' || :P1_USER || ',', ',' || USER_NAME || ',') > 0 OR (USER_NAME = USER_NAME AND :P1_USER is null)
-
Is it possible to display the dynamic value in the ToolTip?
I tried:
this.assist.toolTip.value = this.rawValue; for a text field on 'ownership' MouseEnter
but it does not display the current raw value. It displays a previous raw value of the field...
I wrote 'YYYY', but is not displaying on the first mouseEnter event
When I show event mouseEnter for the 2nd time it gives good value.
Now, I changed the "BBBB" value but the first mouseEnter event it displays the value previous i.e. "YYYY."
I found the solution. I wrote the script ("this.assist.toolTip.value = this.rawValue ;") on 'property MouseEnter' but the need to write the script to the "Output" of the field event. ")
Thank you.
-
Convert multiple lines in a single value separated by commas
Is is possible to convert multiple lines in a single value by concatenating the value of each line in OBIEE. I think that IO had seem a blog related to this by I'm not able to find him. Essentially, here's what I would do:
Number of customer location
101
101 NY
101 PA
102 TX
102 CA
This is to convert
101. HE, NY, PA
102 TX, CA
Can you get it someone please let me know if this is possible and how to operate it.
Thanks in advance for the help.You can do this by creating a DB function,
Visit this link
Re: Display of the horizontal valuesThank you
Vino -
Left join of the two tables and multiple values into a single value separated by commas
Hello
I have following tables with their structures and their data as below.
CREATE TABLE 'BETODI '. "" BETINFO ".
(
VARCHAR2 (8 BYTE) "CURRENTPRESS."
ENABLE 'TYPEIDCONTAINER' VARCHAR2 (30 BYTE) NOT NULL
)
INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A24G', 'PMC');
INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A24D', 'Pensky-MARTENS');
INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ("A25D", "CMP");
INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A25G', 'PMC');
INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A26D', 'PMC');
INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A26G', 'PMC');
INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ("A32G", "V-BFC3");
INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A32D', "V-BFC2");
CREATE TABLE 'BETODI '. "" BETMASTER ".
(
ACTIVATE THE "CUREPRESS" TANK (5 BYTES) NOT NULL,
ACTIVATE THE "TYPE" VARCHAR2 (5 BYTE) NOT NULL,
NUMBER (5.0) "LASTPCIRIM".
)
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A24', '45 M 8', 15);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A25', 42 16', 15);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A26", 16' 45, 15);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A27", '45 M 34', 16);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A28', '45 M 34', 16);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A29', '45 M 34', 16);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A30', '45MCH', 15);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A31", "45MCH", 16);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A32', '45MCH', 16);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A33', '45MCH', 16);
INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A34", "45MCH", 16);
These two tables have left join as
BETMASTER. CUREPRESS = substr (BETINFO. CURRENTPRESS, 1, 3)
now I want to have the data in the two tables with fields Curepress, Lastpcirim, typeidcontainer.
Also something like
Make a group of typeidcontainer if this value is greater than 1 by press separated the values of semicolon (;)
So, for example above, we should be given as
A24 PMC 15; PENSKY-MARTENS
A25 15 PMC
A26 15 PMC
A27 16 (NULL)
A28 16 (NULL)
A30 15 (NULL)
A31 16 (NULL)
A32 16 BFC2-V; V BFC3
A33 16 (NULL)
A34 16 (NULL)
How could do?
My current request is as
Select distinct Curepress, lastpcirim, typeidcontainer
BETMASTER STD left join INF BETINFO
on the trim (STD. CUREPRESS) = substr (trim (INF. CURRENTPRESS), 1, 3)
but I am unable to get the values separated by commas.
Any help would be appreciated.
Thank you
Mahesh.
Hi, Mahesh,
If you want to only 1 row of output for each distinct combination of currentpress and lastpcirim? This sounds like a job for GROUP BY.
And you want the row to contain a list of all different typidcontainers-delimited? This sounds like a job for the aggregate LISTAGG function.
WITH joined_data AS
(
SELECT DISTINCT
MST.curepress, mst.lastpcirim, inf.typeidcontainer
OF betmaster STD
LEFT JOIN betinfo ON TRIM (mst.curepress) inf = SUBSTR (TRIM (inf.currentpress)
1
3
)
)
SELECT curepress, lastpcirim
LISTAGG (typeidcontainer, ',')
THE Group (ORDER BY typeidcontainer) AS container_list
OF joined_data
Curepress GROUP, lastpcirim
;
Unfortunately, you can't say LISTAGG (DISTINCT ...), so you should always get the separate containers how you already are. (Note that the subquery is just what you posted).
Thanks for posting the CREATE TABLE and INSERT statements; It is very useful. Don't forget to tell what version of Oracle you are using. LISTAGG was new in Oracle 11.2.
Why not add CHECK constraints (and perhaps triggers) to your tables, so that curepress and currentpress are not stored with the head or trailing spaces? Then you wouldn't need to use the PAD in queries like this, and your code would be simpler and more effective.
-
Is it possible to convert an array of values in a comma-delimited-list?
Hello
I want to transform the following dataset:
Parent | Child
----------------------
Charles | William
Charles | Harry
Anne | Peter
Anne | Zara
Andrew | Beatrice
Andrew | Eugénie
in this:
Parent | Children
-----------------------------
Charles | Diana, Camilla
Anne | Peter, Zara
Andrew | Beatrice, Eugenie
In other words, I would like to make a list of values from some of the major and produce them as a comma-delimited list.
I know that his is possible in T - SQL, even if the method is a bit of a nasty hack. Is this possible in PL - SQL?
Thaks in advance
JamieSQL> with t as( select 'Charles' parent, 'William' child from dual union select 'Charles', 'Harry' from dual union select 'Anne', 'Peter' from dual union select 'Anne', 'Zara' from dual union select 'Andrew', 'Beatrice' from dual union select 'Andrew', 'Eugenie' from dual ) -- -- select parent, rtrim(xmlagg(xmlelement(e,child || ',')).extract('//text()'),',') childs from t group by parent / PARENT CHILDS ---------- -------------------- Andrew Beatrice,Eugenie Anne Peter,Zara Charles Harry,William 3 rows selected.
Don't know how Diana & Camilla suddenly jumped in many... ;)
-
Definition of child page value to the Parent page text field
Apex 4.1.
I have a form of the apex. When the user clicks a button on this page, it redirects to another page and the user can select a value from a list of values (Group of Radio buttons) and when the user click on the "Done" button on the second page, I'm again redirect to the front page and what needs to happen is the selected value in the second page should be set to a text field in the first page (parent). How can I do this, I tried the following,.
(1) on the second page (list of values), I added a process to get the selected value and set it to the field of the 1st page (Page Item)
(2) I created a branch to redirect to the first page when the user hit "Done" button and in the branch options, I gave the order of the day of the 1st page (at what value need to be defined) and the value selected in the second page.
(3) in both methods, after redirection back to (1) parent Page, I checked the value of this particular text field page element, and it had the value selected in page 2. but still, it was did not update the user interface.
Really grateful if someone can help on this.Apex-EPA,
Some things could happen...
1. your text field still has its source type by replacing the value and is overwhelming everything you set the value on.
2. on your second page, you do not use the branch that you think that you use to return to the first page.
3. your branch to the first page is clear the cache on the first page.Here is an example of this work: http://apex.oracle.com/pls/apex/f?p=43401:35:0
See you soon,.
Janet Tyson -
Drop-down list value is displayed in another text field
Hello - I found this script in the Forum, but I am not able to do
to work. I have the script from the drop-down list change event field. What is chosen in the ddl will appear in TextField12. The ddl works very well, but the selected value does not appear in the text field to page 4.
If
(xfa.event.fullText == 'Supervisor')
{
page4.pcEquip.dirAbove.TextField12.RawValue
= 'Supervisor ';
}
If
(xfa.event.fullText == 'Manager')
{
page4.pcEquip.dirAbove.TextField12.RawValue
= "Manager."
}
If
(xfa.event.fullText == 'Director')
{
page4.pcEquip.dirAbove.TextField12.RawValue
= 'Director '.
}
If
(xfa.event.fullText == "VP")
{
page4.pcEquip.dirAbove.TextField12.RawValue
= "VP";
}
on the other
{
page4.pcEquip.dirAbove.TextField12.RawValue
= null;
}
Any help is appreciated.
Thank you
MDawn
I would use a generic code as follwing... in case of change of DD...
If
(xfa.event.change! = 'Please sΘlectionner') {//when something other than "Please select"
page4.pcEquip.dirAbove.TextField12.RawValue
xfa.event.change =; assign a current selected value to the text field.
}
else {//when "Please sΘlectionner"
page4.pcEquip.dirAbove.TextField12.RawValue
= ""; Clear the TextField value
}
Good luck
-
Need help: I need a checkbox for auto fill a value defined in the separate text field.
Hi, this is my first time with the inclusion of scripts in a PDF form.
We have a form that requires the user to check a box on medical conditions, they have (e.g. asthma, diabetes, Hypertension). Later in the form, you must type the same condition in a text box. (I know it's stupid to the double document, but it is necessary). Y at - it a script that will automatically fill the text box when the check box? For example, if they check the asthma, the text box on a page in the PDF file will say "Asthma, controlled." Is this possible?
In addition, if they don't click asthma and click on diabetes, could you add diabetes to the first text box, but if they check them both, he would add asthma in box 1 and box 2 diabetes?
Any help would be GREATLY appreciated.
I'm using Acrobat 9
Thank you!
You could try to penetrate into this scipt in the text box that will contain the word 'Asthma', as appropriate.
The screenplay is based on the boxes with the names "cbAsthma" and "cbDiabetes".
The script in its present form adds the text in a box.
As always with these scripts, they are case-sensitive.
var a =' '
If (this.getField("cbAsthma").value is "Yes")
{
a = 'asthma (controlled).
}If (this.getField("cbDiabetes").value is "Yes")
{
a = a + "Diabetes".
}Event.Value = has
Hope that it will be somewhere near you looking for
-
backup sql output as separate command values
Hello
version 10.2.0.3
I am trying to wrap an output select sql in the form of values separated by commas. Could you help me on this please?
I'm getting
1234, testdata (spaces), atr
Expected result:
1234, testdata, atr
Thank you
Published by: APV on October 7, 2009 09:30If you don't mind each column space padded then you can use:
set colsep ,
But if (as I think is the case with your query) you want to get rid of the padding, then you're going to concatenate columns together in a single string:
select col1 || ',' || col2 || ',' || col3 from
Additional note: If one of your columns contains commas in the data, you'll probably like too much quoting them and double quotes in the data.
Published by: Andy Triggs on October 7th, 2009 10:42
- Hello Experts,
I am new to the apex.
I want to draw a pie with a single value.
that one value should resemble a slice in the pie chart.
I tried, but it shows that any graph as a value.
So please help me in this regard.
Its very urgent.
Please, I beg you.Hello
I don't know if I understand your question, you want to pie chart or line chart? If you draw two lines in a single chart, you add another series to the chart. Click on the graph and click on add another series, enter another sql for the series and you should be all set. Thank you.
Kind regards
ManishRetrieve a single value from a file .lvm
I have a large batch of files of worksheet whose name is a timestamp. I am writing a program that will get the value of a specific cell (the same cell in each file), coupled with the timestamp and each of them as a pair of coordinates, then save in a master spreadsheet. The goal is to extract a point each of the 700 files I and compile them into a single file.
However, I've never used Labview to read the files before. I saw some stuff on how to read an entire worksheet in a table, but I was wondering if there was a way to say to Labview to look into a file and extract a single value. I open .lvm in Excel files, so, in my mind, I would be taking, for example, cell D2. Is this feasible? Should I read the entire worksheet in an array and use the index to pick it up on the table? If I do, how I would specify cell J2 as an array index (I have no experience with the berries in Labview either). In addition, if you have any tips on how to record easily 700 pairs of coordinates, that came together in the order, to a single spreadsheet, that is my next task.
Essentially- I need to extract a single value of a spreadsheet in, ideally, the simplest possible. In addition, pointers on how to save the numbers gathered at each iteration of a while loop to a single worksheet are welcome.
Thanks in advance for the help!
FYI I have LabView v8.6
You can't say LabVIEW to 'out' a specific 'cell' more you can tell Notepad to do. the .lvm files are just text files. When you open them in Excel, the column separator (default tabs) show to put the values in columns. In LabVIEW measurement file VI reading to read .lvm files. It creates the dynamic data, wrong data type that is next to useless. You will need to convert this type of data in a table by using the function convert of DDT. Or, you can use the VI read spreadsheet file. This will give you a table directly. You can just remove the specific item using the table to Index.
How to write a single value in an excel spreadsheet
Hello
I use an excel spreadsheet, as if it were an external code module. He does a lot of calculations, all I do is write an individual value, let calculate what it should only then read a return value from this.
I already have a structure able to read a table, but could someone help me with a piece of code that could write a single value?
(To read a value unique too may be practical)
Also, I have the new LabVIEW 2009, so while a fancy to drop some code here as one. PNG, it would be nice to see if this new feature works!
Thank you, Alec
Try this. There are 2 point methos (get) and point (put) to read and write the value respectively to a cell in excel.
Good luck
Prob Winmail.Receive the error message "the server that you are connected using a security certificate that could not be verified that the certificate CN name does not match the passed value. Do you want to continue? ». This started happening after that my laptop has been reformatted. I have synced with Gmail winmail and followed the instructions to do this correctly. By pressing the tab 'Yes' allows me to use winmail, but it's a little embarrassing.
Using a digital signature? Check the settings under Tools | Options | Security and also tools | Accounts | Mail | Properties | Security.
Also, see here (http://mail.google.com/support/bin/answer.py?hl=en&answer=86382) and make sure that your settings are correct.
Steve
How to pass the values separated by commas in SQL query
Hi all
I use Oracle APEX 4.2
I've created a report of iterative with condition 1 ITEM IS NOT NULL.
This is the SQL query
SELECT MY. ACCT_ID,
JAI DETAILS
The ACCT MA, ACCT_hist EB
WHERE MY. ACCT_IK = EB. ACCT_IK
AND MY. ACCT_ID IN (: P3_IN_MRN);
A P3_IN_MRN element is a text field. The thing is that it works if I give a value, but its does not work if I have several values with comma separated as 123,345,543.
What could be the solution for multiple values in the SELECT query.
Really appreciate your help.
I made use of this on pretty much every project I've worked on:
https://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:210612357425
Hope that helps.
Duncs
Maybe you are looking for
-
How can I change the language implemented
I just bought a second hand MacBook Pro. He had the remains of someone elses account (no iCloud or iTunes, I checked before buying) so I wiped the hard drive and reinstalled the operating system. The only problem is that it's now in Hungarian (I don'
-
Simulate the presence of an instrument
Hi all! I read the data of an instrument which is in the laboratory and where there is junt a version of the runtime of labview instaled. The instrument is a GPIB multiplexer interface that uses sustainable intensification of CROPS. To get informatio
-
Home product key does not work
Last time I reinstalled Windows XP Home Edition, it is not accepted the product key that comes with it. So I called Microsoft and team working with product keys gave me a new product key for the CD. I lost the paper where I wrote the product key and
-
Windows XP logon screen does not appear
Laptop of my colleague was recently hit by the tdss rootkit malware. I think I could clean out of his system. When trying to load the computer out of safe mode, the Windows XP splash screen appears, he will then travel to the blue screen (BSOD no),
-
A friend of mine gave me this computer about 2 or 3 months without a hard drive, thanks to a little research because I am not a professional of any kind, I knew that, because of the lack of a disk hard computer did not have an operating system. Havin
- Hello Experts,