SQL Search list for value

Hello all,
I am trying to search a huge table of users to see if they
belong to a certain group. The group field would be as follows:
group_id = 1,2,4,7
In the interest of server memory, I do not want to pull the
entire table and search with CF (listfind). Instead, I would like
to run an SQL query like this:
Select *
FROM table
where group_id CONTAINS '2'
Of course I can't do this. I'm a liitle rusty on my SQL.
Could someone help??
Thanks

MySQL may have functions that allow you to find a value in a
list. If not you may need to use a series LIKE statements. Either
way the query will almost certainly be slower than if your data
were properly normalized.
Field = '2' OR Field LIKE '2,%' OR Field LIKE '%,2,%' OR
Field LIKE '%,2'
Storing data in that manner is generally considered a bad
design. One of the reasons is what you've discovered: its difficult
to query. I would strongly recommend that you normalize your data.
User Table: UserID, UserName, ...
Group Table: GroupID, GroupName, ...
UserGroup Table:
UserID | GroupID
1 | 20
1 | 2
1 | 4
1 | 7
3 | 20
3 | 89
3 | 22
5 | 122
Your query would be simply
SELECT UserID
FROM UserGroup
WHERE GroupID = 2

Similar Messages

  • Item level ststus not showing search list for agent inbox

    Hi,
    while selecting item level ststus in agent inbox it is not showing records in search list.so many records existed in system based on item leval ststuses.
    currently working on crm 7.0
    can u please help me out to solve this issue
    Thanks & Regards
    kishore kumar

    Hi,
    i performed all settings regarding map inbox etc.still i am not able to see results list based on item level ststus.these ststus profile assaigned to item catageory
    Thanks & Regards
    Kishore Kumar

  • Drop down list for values at parameters forconfigurable product in CRM 2007

    Hi All,
    I want to create configurable service products in CRM 2007 connected with SAP IS-U.
    I uses the simplified product configuration, container approach. Hierarchy, settypes are set.
    Then I created parameters like for example discount, I can set in the WEB UI default value for this parameters, like 5%.
    But I need to have more variables for one parameter.
    For example:
    The agent sells an electricity product to the customer, and wants to configure the product in the sales process, give a discount from 5, 10, 15%.
    This variables 5,10,15% I like to get somehow in a drop down list, that the agent has a choice wich discount he gives.
    Thanks for any answers!
    Gabor

    Patrick,
    In PPOMA, did you check the requester for inheritance?  If the values are maintained at a higher level, is the inhertiance working to the requester level in the org structure?
    Regards, Dean.
    Edit: I just your reply to the previous posting, do you have one set as a default?
    Edited by: Dean Hinson on May 20, 2008 3:27 PM

  • Restrict dictionnary Search help displayed values.

    Hi,
    my problem is that I have to display a search help. The search help already exists in the dictionnary and is defined using a Dictionnary Table.
    I need to display the same serach help but I have to filter the results using a range of values for one of the fields and I would like to know how to proceed.
    I know that user-exit exists in some search help, it's not the case here.
    The kind of solutions I'm looking for is :
    -  directly restrict the existing search hellp values
    -  found a way to display a search help from abap using an internal table ( cause it's easy in this case to do fill a internal table doing the sql request myself)
    - if the solutions above can't apply, doing my own search help in the dictionnary but in this case, I don't know to make this search help for values restriction.
    I specify that the screen use the screen painter, it may be important ?
    Thanks for your help
    best Regards,
    Morgan

    Hi,
    Search Hels exits is only for exceptions, so in our case, we won't use the search help exits, it is better create/change the Custome one and attach the same to the fiels, there you can give the Default value for the fileds, so there you can restrict the values
    or else, we have an option like, APPEND SEARCH HELPS, so by using this, we can restrict some field values, this Append Search helps, can be append to Standard Search helps also, so do Append the Standard Search help and add your field and give the Default values to restrict the user
    hope you get the answer
    Regards
    Sudheer

  • Security create-keychain does not add the keychain to search list

    Hello guys,
    It seems that since OS X Mavericks the security create-keychain does not add the keychain in the search list. I tried calling the SecKeychainCreate directly to verify that this is not a bug in the SecurityTool (the result is the same). Could you please help me verify if this is expected behavior or more like a bug that was not reported?
    Is there other way to create a keychain and add it to the search list except modifying the whole search list (for ex. using the security list-keychain)? I would like to concurrently create more than one keychain and modifying the whole search list does not seem like a good practice, becuase it introduces a race condition.
    P.S. I tested this in Yosemite and the behavior is the same.
    Regards,
    Ilian Iliev

    Hi Carla,
    Sorry to ask such a basic question, but are talking about Oracle Sales Analyzer?
    Thanks,
    Stuart Bunby
    OLAP Blog: http://oracleOLAP.blogspot.com
    OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
    OLAP on OTN: http://www.oracle.com/technology/products/bi/olap/index.html
    DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html

  • Creating search help for AFNAM, and display the hit list with values only

    Hi guys,
    I have created a search help for AFNAM, but the hit list displays all even if it is blank.
    I want to display in the hit list the AFNAM with values and do not diplay the blank values...
    Is it possible? How am i going to do it?
    Thanks!
    Mark

    Hi Mark,
    After selecting data use this statement.
    DELETE it_table WHERE AFNAM is initial.
    Regards,
    Suneel G

  • Creating List of Values for Parameters in Crystal Report

    Dear All,
    I have created a Report using Crystal Report XI and integrated that with VB Dot Net.  It uses a Stored Procedure (SQL 2000) to retrieve data.  The stored procedure has some parameters.  When I run the VB dot net exe, it prompts for the parameters.  However, I like to pass a List of Values to the Parameters, which the end user must select from the same.
    How can I create a List of Values and attach to the Crystal Report.
    Please help me in this regard,
    Naren.

    Are you trying to set a bunch of default values (e.g.; 1st name, last name, address, order number, etc.), or an actual List of Values?
    Also, remember to search the forums for possible solutions. When I enter "parameter" in the search box, I get over 7 pages of links...
    The [notes|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=&adv=true] database and [articles|https://www.sdn.sap.com/irj/sdn/businessobjects-articles] are great information resources also.
    Oh, and confirm exact version of CR used.
    Ludek

  • Make List of Values for Required Bind Variables

    In the SQL query for my View Object, I have a bind variable, which I set to "required". In the search form resulting from a View Criteria, a textbox shows up asking the user for the value of that variable. Is there a way to make it a List of Values instead?

    Hi WV,
    Create a transient attribute in your VO that contains the LOV and then set the value of your bind variable to point to this new transient attribute. Also here is another approach
    https://blogs.oracle.com/shay/entry/adf_query_with_parameters_and
    Let us know how it goes.
    -Juan Camilo

  • Validation error message is not displayed for an attribute as an Input List Of Value

    Hi everyone,
    I use jdev 11.1.1.7.0
    In my application I've created an Entity Obj and a View Obj base Employees table.
    for the JobId attribute I've taken actions as listed below:
    1. in Employees EO I've created a validation for this attribute and in some cases an error message returns (the error message is "the salary is not high"):
         * Validation method for JobId.
        public boolean validateJobId(String jobid) {
            if (...) {
                return false;
            if (...) {
                return false;
            if (...) {
                return false;
            return true;
    2. in Employees VO  I've created a LOV for this attribute (the view accessor is JobsViewObj ) and I display the attribute as an Input Text with List Of Values.
    in jspx page I drag& drop this attribute as below:
              <af:inputListOfValues id="jobIdId"
                                    popupTitle="Search and Select: #{bindings.JobId.hints.label}"
                                    value="#{bindings.JobId.inputValue}"
                                    label="#{bindings.JobId.hints.label}"
                                    model="#{bindings.JobId.listOfValuesModel}"
                                    required="#{bindings.JobId.hints.mandatory}"
                                    columns="#{bindings.JobId.hints.displayWidth}"
                                    shortDesc="#{bindings.JobId.hints.tooltip}"
                                    autoSubmit="true">
                <f:validator binding="#{bindings.JobId.validator}"/>
              </af:inputListOfValues>
    I open the Popup and I select a row from the Popup list and then I click Ok. After that if the validation method(validateJobId) returns false, the error message("the salary is not high") must be show to the user. but the error message doesn't display. I don't understand why this happens.
    Can anybody guide me about this problem?
    Regards
    Habib

    yes, you're right, I've tested it in 12.1.3 and error message was displayed.
    it seems it's a bug(bad bug ) in both 11.1.1.7 and 12.1.2. and now what can I do? is there any way to display the the error message?
    Regards
    Habib

  • Enhancing standard (single select)search help for Multiple value selection

    Hi,
    Standard search help for Business Partner (in cProjects) allows only single value selection for input fields. I want to make this multiple selection.
    Is there a way to do it.
    I used an OVS and built a similar search but its difficult to get the standard options like saving to personal value list etc in it.
    It would be good if there is a way to modify the standard search help to allow multiple selection. Any ideas??
    Appreciate your help,
    Thanks,
    Sri
    Edited by: Sri on Sep 9, 2010 8:50 PM
    Edited by: Sri on Sep 9, 2010 8:52 PM

    As far as I know you can't make a standard ABAP dictionary search help return multiple entries - where you get this sort of functionality the searches don't use the standard Elementary search help framework (e.g. organisational structure searches)
    Given that the WDA search help relies on these dictionary based searches, I'd think very much that you couldn't enhance it to return multiple. how you could even return multiple entries into a single UI element input field is also confusing to me.
    I'd suggest creating a freely programmed value help, it would certainly take quite some effort to recreate those personal value lists etc, but it could be done - I don't like OVS, but that just me.

  • Search Help for input field2 based on value entered in input field 1

    Hi All,
    I have a requirement where in my view, i have two fields.
    1. PO
    2. PO Item
    For PO i could get the standard search help from DDIC, but i need to provide search help for PO Item based on PO selected.
    How can i do that. Any help is highly appreciated.
    Thanks,
    Ajay

    Hi Ajay ,
    following steps cn help u :
    1 Declare the WDR_OVS Component in the used component list in your WD component .
    2  Now go to the View, in the Properties Tab click the Create Controller Usage Button.
    3 It will open a screen with Component Use Entries. There select the Component Use OVS with Interface Controller . Press Enter.
    4 Go to the Context Tab, Right Click the Context and select Create à Attribute , for PO item in ur case .
    5 In the Input Help Mode Field, Select u2018Object Value Selectoru2019 from the dropdown. Then press F4 in the Field OVS Component Usage.
    6 Declare one event handler method with Name ON_OVS in the Method tab of the view. Then Press F4 in the Column Event. 
    Select the Event OVS as shown below and Press Enter. 
    for more info and illustration , also refer :
    http://help.sap.com/saphelp_erp2005/helpdata/EN/30/d7fa41c915da6fe10000000a1550b0/content.htm
    https://wiki.sdn.sap.com/wiki/display/WDABAP/ABAPWDObjectValueSelector(OVS)
    http://wiki.sdn.sap.com/wiki/display/Snippets/OVSSearchHelpinWebDynproAbap
    regrds,
    amit

  • Parameter Form-How to use a user parameter to retrieve list of values for another par

    I am developing a report in Reports 6i. There are 2 parameters on parameter form namely year and month.
    LOV for Year is retrieved from database. After user selects a value from LOV for year, I want to retrieve another LOV for month parameter based on selected year. That is how can we use a user parameter's value to dynamically retrieve an LOV for another parameter on the same parameter form.
    Pl. guide.
    Thanks in anticipation.

    You can't restrict the "List of Values" of one parameter based on the value of another parameter within the Reports Builder/Runtime parameter form.
    The SQL select statements within LOV's are only executed once. They aren't re-calculated when you enter, leave or change other field values in the parameter form. This is mainly because there is no event model in the Reports parameter form and it only supports basic form functionality.
    To do what you're after in a client-server environment you need to create an Oracle Forms "parameter form" and use that to execute the Report using the run_product() call. Actually, you should probably use Oracle Forms for any more generic "form" functionality such as radio buttons or check boxes.
    If you're in a Web rather than Client-Server environment, it may be easier to create a JSP based parameter form. You can then use Reports 9i since it has JSP support to assist here.

  • SQL Statement ignored performing List of Values query

    Hi, New user just learning the basics. I have created a simple table PERSON with columns, ID, firstname, lastname, phone, city, State_ID
    Then clicked create Lookup table - State_Lookup with columns State_ID and State_Name.
    I create a page, include all columns from PERSON. For State the field is a select list that should do a lookup form the STATE_LOOKUP table. (I have entered 4 states in the table)
    I am getting the following error however:
    Error: ORA-06550: line 1, column 14: PL/SQL: ORA-00904: "STATE_ID": invalid identifier ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored performing List of Values query: "select STATE_ID d, STATE_ID v from STATE_ID_LOOKUP order by 1".
    I have not entered any sql, just selected all of my options using defaults and dropdowns. What is causing the error and what do I need to change?
    Thanks

    Okay, learned something: The database link name used, must not contain a dash. The DB_DOMAIN is appended automatically when you create a DB link, so if IT contains a dash, the db link name does as well. Check DBA_DB_LINKS to make sure you don't hit this well-hidden feature.
    Regards
    Martin Klier
    [http://www.usn-it.de|http://www.usn-it.de]

  • Display list for Vendor search in SC tcode in SRM 7

    Hi all,
    We are on SRM 7.1 ECS.
    THe vendor search help display list in SRM 7 in the SHOP in 1 STEP tcode displays number of columns like VENDOR ID,name,street,city etc...IN SRM 5,there were only limited number of clumns(around 6) displayed like vendor ID,name,Porg,DUNS etc.
    I know in SRM 7,we can right click and always chnage the USER settings for each individual session/user.BUt if I need to craete a default display list for the vendor serach in the SC transaction,is that possible?
    Also if I modify the web dynpro application to limit the no of culmns,then changes will be displayed in all the trasnction sin which the vendor search help might be used.
    Users in our org have problemw when scrollingtop to bottom in the result list which is displayed for the vednor seaqrch due to the new web dynpro UI in SRM 7 and hence the query.
    Any suggestions will be highly appreciated.
    Thanks in advance for your time.

    Hi Scot
    the below is for goa . try for BP too.. Why you require TREX search . std search dont enough. since
    TREX helps only if you want to enable  full text search for long texts and attachments in contracts.You need to instal  the trex server and configure the settings:-
    1.create RFC destination of type TCP/IP server using TCODE SM59
    2.MAINTAIN ENTRY IN back end systems settings
    3. Activate full text search y executing the program BBP_TREX_INDEX_ADMIN .
    bUSINESS oBJECT : - bus2000113
    subtype usiness object :- cc for GOA or blank for operational contracts
    Action for SRM TREX index :- select the appropriate value from search help . for example , you would specify A for the initial index generation.
    bundle size for indexing : enter "10." bundle size affects performance. The size indicates the number of docuemnts that will be updated in one pass.if there are a large number of documents, then the size may be reduced to improve performance

  • Search for values in class

    Hi all,
    I am fetching data in the following manner,
    1.     Find the deliveries items based on the search criteria
    2.     Pull in the material numbers for each item in the delivery
    3.     Pull in Planned goods movement date LIKP-WADAT
    4.     Exclude materials in the list where MARA-MAGRV = TB01
    5.     Find the External material group value for the remaining list MARA-EXTWG
    6.     Search for values in class ZEHS_DATA
    7.     Pull in value for characteristics
    i.     ZEHS_PLANT
    ii.     ZEHS_RELEVANT
    8.     Eliminate delivery items where ZEHS_RELEVANT = N for next steps, however display what was found
    9.     With EMG for delivery items and ZEHS_RELEVANT = Y pull all fields.
    In which the class ZEHS-DATA is having fields like:
    ZEHS_FORM
    ZEHS_RELEVANT
    ZEHS_PLANT
    COLOR_SUNNBR etc,
    My question is how do I pull values from class ZEHS_DATA??
    Thanks,
    Debrup.

    Hi
    if you have values in a variable declared in CLASS, just call another method of this CLASS with an export paramtere ( export means exporting to the program)
    depending the requirement the method can be PUBLIC or PRIVATE etc
    Regards
    Ramchander Rao.K

Maybe you are looking for

  • NFe complementar - Erro no campo nº da NF-e

    Bom dia, Estou com um outro problema crítico de NFe. 1- Como é uma nota fiscal complementar é feito o processo e no momento de salvar, gera uma NF saida. 2- O erro encontrado é que no momento da criação ele pede o numero da nf... o qual o SAP deve ge

  • [b]1 OC4J JBUILDER Deployment Problem[/b]

    I cant use the admin.jar from oracle to jbuilder for make a deploy in IAS, i was catching a error ... I need to remotely deploy some applications with Oracle, but until now i haven't succeed at all. Every time i try to deploy with D:\Borland\JBuilder

  • Value of report bind variable in the add PL/SQL section?

    Hi all, I'm passing a page parameter into a report as a bind variable - this works. Now I need this same parameter value in the additional PL/SQL section of the report. I have browsed the forums & docs and seems like get_value(<param_name>) is suppos

  • Payment Procedure for Import Purchases

    dear gurus, I want to know the procedure to be followed for Import Purchases.  How do we capture LC details in SAP & clear the payment against that. regards, Naidu

  • Check see if string passed in param matches with substring in the data str

         // method that check to see if the string passed as the param appears as a      // substring in the data string      public boolean lookSubstring(String _data)           for(int i = 0; i < _data.length(); i++)                if(_data.equals(data