Loop at where not in

can anybody send me example of NOT IN with loop at  itab where  filed not in (a, ,b, c )
when i use brackets becomes red..i  dont know why

Code like the way below;
data: st_tab type table of selopt with header line.
    st_tab-sign = 'I'.
    st_tab-option = 'EQ'.
    st_tab-low = 'A'.
    append st_tab. clear st_tab.
    st_tab-sign = 'I'.
    st_tab-option = 'EQ'.
    st_tab-low = 'B'.
    append st_tab. clear st_tab.
    st_tab-sign = 'I'.
    st_tab-option = 'EQ'.
    st_tab-low = 'C'.
    append st_tab. clear st_tab.
    loop at itab not in st_tab.
    endloop.

Similar Messages

  • Whats the difference between a loop at where cndition and a read statmnt

    Hi.
    Whats the difference between a loop at where cndition and a read statmnt??
    The read statement fails but the loop at where cond works fine...
    READ TABLE t_stpo INTO wa_stpo
                                      WITH KEY idnrk = wa_keko-matnr
                                      BINARY SEARCH.
    LOOP at  t_stpo into wa_stpo where idnrk = wa_keko-matnr.
         endloop.
    Why is it so??

    Hi..
    Check out the Differences below.
    <b>SORT T_STPO BY MATNR.</b>
    <b>READ TABLE t_stpo INTO wa_stpo
    WITH KEY idnrk = wa_keko-matnr
    BINARY SEARCH.</b>
    The READ TABLE statement reads a single record from internal table.
    Binary search can be used to optimize the Search time based on key.
    But Sorting is must before using BINARY SEARCH.
    Always use READ TABLE When u need a single row from internal table.
    Bcoz it will not process all the records of internal table.
    <b>LOOP at t_stpo into wa_stpo where idnrk = wa_keko-matnr.
    endloop.</b>
    The above LOOP .. ENDLOOP statement using WHERE Condition is used when there can be multiple rows satisfying the Condition.
    It will actually Processes all the Records in internal table and returns only the records matching the condition.
    So it will always take more time.
    <b>Reward if Helpful</b>

  • Sym.play("loop"); This is not working

    Please'm having problems with the LOOP. 've Followed several tutorials but the file does not end LOOP function. You guys could send me a link where I can get a solution to this problem?
    // play the timeline from the given position (ms or label)
    sym.play("loop"); This is not working (sorry for the english: Translate)

    sym.play("loop"); will move the root timeline playhead to the "loop" label, and play from that "loop" label.
    If you want to loop a section, for example, you could put a label called "loop" at 1 second, and then at 3 seconds, add a timeline trigger that has the code sym.play("loop");

  • How can I update cluster items from inside a while loop that does not contain the cluster?

    I have a VI that contains front panel clusters and two while loops. The main cluster contains items such as a doubles "distance" and "stepsize" and boolean "step" (a whole buch of this type stuff). The first loop contains an event structure to detect front panel changes and the second contains code and sub VIs to perform operations based on detected events.
    The operator can enter data into either double or click the boolean. If distance is changed the second loop does what is required to process the change. The same happens with stepsize. If step is clicked the ±stepsize value is added to distance and the result is processed. In each case the front panel should track the result of the input and subsequent processing.
    Because the clusters are outside the while loop, they are not updated unless I click 'highlight execution' which seems to allow updating each time the execution highlight is updated. There are other issues if I move the clusters into one of the loops.
    I've tried referencing the clusters and using local variables and nothing works. It looks like overkill to use shared variables for this.
    Any ideas would be greatly appreciated.
    Thanks,
    Frank    

    Hi Ben,
    Thank you for the response. I followed the link and tried reading everything you posted on AEs but I'm afraid that I didn't understand it all. It seems that each AE example had a single input and a single output (e.g. a double). Is this the case? 
    What I have is a couple of front panel clusters containing (approximately) 18 control doubles, 8 indicator doubles, 5 boolean radio button constructs and 26 boolean control discretes. I clusterized it to make it readable. In addition I'll eventually have a cluster of task references for hardware handles.
    All I want to do is update the front panel values like I would do in a C, VB or any other language. I've tried referencing the cluster and using the reference from inside the loops. I've tied using local variables. Neither works. I'm experimenting with globals but it seems that I have to construct the front panel in the gloabal and then I wouldn't know how to repoduce that on the front panel of the main VI.  Sometimes it seems that more time is spent getting around Labview constructs than benefitting from them.
    I hope the 'Add Attachment' function actuals puts a copy of the VI here and not a link to it.
    Thanks again for the suggestion,
    Frank 
    Attachments:
    Front Panel Reference.vi ‏33 KB

  • Using WHERE NOT EXISTS for a Fact Table Load

    I'm trying to set up a fact table load using T SQL, and I need to use WHERE NOT EXISTS. All of the fields from the fact table are listed in the WHERE NOT EXISTS clause. What I expect is that if the value of any one of the fields is different, that the whole
    record be treated as a new record, and inserted into the table. However, in my testing, when I 'force' a field value, new records are not inserted.
    The following is my query:
    declare 
    @Created_By nchar(50)
    ,@Created_Date datetime --do we need utc check?
    ,@Updated_By nchar(50)
    ,@Updated_Date datetime
    select @Created_By = system_user
    ,@Created_Date = getdate()
    ,@Updated_By = system_user
    ,@Updated_Date = getdate()
    insert fact.Appointment
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    select distinct
    Slot.Slot_ID 
    , Slot.Slot_Start_DateTime  as Slot_DateTime --???
    , Slot.Slot_Start_DateTime
    , Slot.Slot_End_DateTime
    , datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) as Slot_Duration_Min 
    , Slot.Created_Date as Slot_CreateDateTime
    , SlotCreateDate.Date_key as Slot_CreateDate_DateKey
    , HSite.Healthcare_System_ID
    , HSite.Healthcare_Service_ID
    , HSite.Healthcare_Service_ID as Healthcare_Supervising_Service_ID
    , HSite.Healthcare_Site_ID 
    , Ref.Booked_Appt_ID 
    , ApptSubmissionTime.Date_key as Appt_Notification_Submission_DateKey
    , ApptCompletionTime.Date_key as Appt_Notification_Completion_DateKey
    , datediff(mi,appt.SubmissionTime,appt.CompletionTime) as Appt_Notification_Duration
    , Appt.Appt_Notification_ID 
    , pat.Patient_ID 
    , 0 as Physician_ID
    , ref.Referral_ID
    , Hsrv.Specialty
    , appt.[Language] as LanguageRequested
    ,@Created_Date as Created_Date
    ,@Created_By as Created_By
    ,@Updated_Date as Updated_Date
    ,@Updated_By as Updated_By
    from dim.Healthcare_System HSys
    inner join dim.Healthcare_Service HSrv
    on HSys.Healthcare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Healthcare_Site HSite
    on HSite.HealthCare_Service_ID = HSrv.Healthcare_Service_ID
    and HSite.HealthCare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Referral Ref 
    on Ref.ReferralSite_ID = HSite.Site_ID
    and Ref.ReferralService_ID = HSite.Service_ID
    and Ref.ReferralSystem_ID = HSite.System_ID 
    right join (select distinct Slot_ID, Source_Slot_ID, Slot_Start_DateTime, Slot_End_DateTime, Created_Date from dim.slot)slot
    on ref.Source_Slot_ID = slot.Source_Slot_ID
    inner join dim.Appointment_Notification appt
    on appt.System_ID = HSys.System_ID
    inner join dim.Patient pat 
    on pat.Source_Patient_ID = appt.Source_Patient_ID
    inner join dim.SystemUser SysUser
    on SysUser.Healthcare_System_ID = HSys.Healthcare_System_ID
    left join dim.Calendar SlotCreateDate
    on SlotCreateDate.Full_DateTime = cast(Slot.Created_Date as smalldatetime)
    left join dim.Calendar ApptSubmissionTime
    on ApptSubmissionTime.Full_DateTime = cast(appt.SubmissionTime as smalldatetime)
    left join dim.Calendar ApptCompletionTime
    on ApptCompletionTime.Full_DateTime = cast(appt.CompletionTime as smalldatetime)
    where not exists
    select
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    from fact.Appointment
    I don't have any issues with the initial insert, but records are not inserted on subsequent inserts when one of the WHERE NOT EXISTS field values changes.
    What am I doing wrong?
    Thank you for your help.
    cdun2

    so I set up a WHERE NOT EXIST condition as shown below. I ran the query, then updated Slot_Duration_Min to 5. Some of the Slot_Duration_Min values resolve to 15. What I expect is that when I run the query again, that the records where Slot_Duration_Min resolves
    to 15 should be inserted again, but they are not. I am using or with the conditions in the WHERE clause because if any one of the values is different, then a new record needs to be inserted:
    declare 
    @Created_By nchar(50)
    ,@Created_Date datetime
    ,@Updated_By nchar(50)
    ,@Updated_Date datetime
    select
    @Created_By = system_user
    ,@Created_Date = getdate()
    ,@Updated_By = system_user
    ,@Updated_Date = getdate()
    insert fact.Appointment
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    select distinct
    Slot.Slot_ID 
    , Slot.Slot_Start_DateTime  as Slot_DateTime --???
    , Slot.Slot_Start_DateTime
    , Slot.Slot_End_DateTime
    , datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) as Slot_Duration_Min 
    , Slot.Created_Date as Slot_CreateDateTime
    , SlotCreateDate.Date_key as Slot_CreateDate_DateKey
    , HSite.Healthcare_System_ID
    , HSite.Healthcare_Service_ID
    , HSite.Healthcare_Service_ID as Healthcare_Supervising_Service_ID
    , HSite.Healthcare_Site_ID 
    , Ref.Booked_Appt_ID 
    , ApptSubmissionTime.Date_key as Appt_Notification_Submission_DateKey
    , ApptCompletionTime.Date_key as Appt_Notification_Completion_DateKey
    , datediff(mi,appt.SubmissionTime,appt.CompletionTime) as Appt_Notification_Duration
    , Appt.Appt_Notification_ID 
    , pat.Patient_ID 
    , 0 as Physician_ID
    , ref.Referral_ID
    , Hsrv.Specialty
    , appt.[Language] as LanguageRequested
    ,@Created_Date as Created_Date
    ,@Created_By as Created_By
    ,@Updated_Date as Updated_Date
    ,@Updated_By as Updated_By
    from dim.Healthcare_System HSys
    inner join dim.Healthcare_Service HSrv
    on HSys.Healthcare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Healthcare_Site HSite
    on HSite.HealthCare_Service_ID = HSrv.Healthcare_Service_ID
    and HSite.HealthCare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Referral Ref 
    on Ref.ReferralSite_ID = HSite.Site_ID
    and Ref.ReferralService_ID = HSite.Service_ID
    and Ref.ReferralSystem_ID = HSite.System_ID 
    right join (select distinct Slot_ID, Source_Slot_ID, Slot_Start_DateTime, Slot_End_DateTime, Created_Date from dim.slot)slot
    on ref.Source_Slot_ID = slot.Source_Slot_ID
    inner join dim.Appointment_Notification appt
    on appt.System_ID = HSys.System_ID
    inner join dim.Patient pat 
    on pat.Source_Patient_ID = appt.Source_Patient_ID
    inner join dim.SystemUser SysUser
    on SysUser.Healthcare_System_ID = HSys.Healthcare_System_ID
    left join dim.Calendar SlotCreateDate
    on SlotCreateDate.Full_DateTime = cast(Slot.Created_Date as smalldatetime)
    left join dim.Calendar ApptSubmissionTime
    on ApptSubmissionTime.Full_DateTime = cast(appt.SubmissionTime as smalldatetime)
    left join dim.Calendar ApptCompletionTime
    on ApptCompletionTime.Full_DateTime = cast(appt.CompletionTime as smalldatetime)
    where not exists
    select
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    from fact.Appointment fact
    where 
    Slot.Slot_ID  = fact.Slot_ID 
    or
    Slot.Slot_Start_DateTime   = fact.Slot_DateTime  
    or
    Slot.Slot_Start_DateTime = fact.Slot_StartDateTime
    or
    Slot.Slot_End_DateTime = fact.Slot_EndDateTime
    or
    datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) =
    fact.Slot_Duration_min
    or
    Slot.Created_Date  = fact.Slot_CreateDateTime
    or
    SlotCreateDate.Date_key = fact.Slot_CreateDate_DateKey
    or
    HSite.Healthcare_System_ID = fact.Healthcare_System_ID
    or
    HSite.Healthcare_Service_ID = fact.Healthcare_Service_ID
    or
    HSite.Healthcare_Service_ID  =
    fact.Healthcare_Service_ID 
    or
    HSite.Healthcare_Site_ID  = fact.Healthcare_Site_ID 
    or
    Ref.Booked_Appt_ID  = fact.Booked_Appt_ID 
    or
    ApptSubmissionTime.Date_key =
    fact.Appt_Notification_Submission_DateKey
    or
    ApptCompletionTime.Date_key =
    fact.Appt_Notification_Completion_DateKey
    or 
    datediff(mi,appt.SubmissionTime,appt.CompletionTime)  = fact.Appt_Notification_Duration
    or
    Appt.Appt_Notification_ID = fact.Appt_Notification_ID 
    or
    pat.Patient_ID  =
    fact.Patient_ID 
    or
    0 = 0
    or
    ref.Referral_ID = fact.Referral_ID
    or
    Hsrv.Specialty = fact.Specialty
    or
    appt.[Language] = fact.LanguageRequested

  • Loop while is not visible

    Hi All,
    In SWDD (Every step type that can be inserted  )are visible but loop while is not visible.What could be the possible reason?Please let me know.
    Kind Regards,
    Anshu Kumar

    Hi Anshu,
    Would like to correct you that the step name is Loop (Until).
    Please check with the basis team if this step is not visible for you.
    Also check if you are not missing out this step while searching.
    Hope this helps!
    Regards,
    Saumya

  • For loop in validation not working

    Hi,
    I am trying to put validation on a tabularform, such that column1 is not greaterthan column2 value.
    begin
    apex_application.debug('start check');
    for i in 1..3 loop
    apex_application.debug('i='||i);
    if apex_application.g_f05(i) < apex_application.g_f06(i)
    then
    return true;
    else
    return false;
    end if;
    end loop;
    end;could not figure out why the loop is not workinng. it is taking only 1st value i.e here "i" takes only value "1" then it checks the condition and later exists, doesnot check for the next row.
    any Idea..,!!!
    Help Me.
    Thanks,
    Little Foot

    Little Foot wrote:
    Hi,
    I am trying to put validation on a tabularform, such that column1 is not greaterthan column2 value.
    \begin
    apex_application.debug('start check');
    for i in 1..3 loop
    apex_application.debug('i='||i);
    if apex_application.g_f05(i) < apex_application.g_f06(i)
    then
    return true;
    else
    return false;
    end if;
    end loop;
    end;could not figure out why the loop is not workinng. it is taking only 1st value i.e here "i" takes only value "1" then it checks the condition and later exists, doesnot check for the next row.
    any Idea..,!!!
    Help Me.One way or another the code returns a value on the first iteration, which obviously always exits the loop at that point.
    (And it's \...\, not \...\)

  • Simulation Loop: Code could not be generated correctly for this VI

    Running LabView Simulation 8.2 on Windows XP laptop.  I have a Simulation Loop that keeps generating the following error message:
    "Simulation Loop: Code could not be generated correctly for this VI"
    The only reference I can find in my searches is to using an RTX target, which does not apply.  When I click on Show Error it just highlights the Sim Loop
    Any ideas on how to debug this?

    Perhaps you can start removing things until you don't get the error any more. How big is the code in the loop?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Wrong query is getting generated in WHERE NOT EXISTS  with group by clause

    Query is getting generated wrongly in where not exists section when i use group by function.Please prvoide me any clue to over come the problem.
    /* DETECTION_STRATEGY = NOT_EXISTS */
    INSERT /*+ APPEND */ INTO STG_ETL.I$_DCMT_TIMEZONE_LOOKUP
         TZ_OFFSET,
         ADT_CRT_DT,
         ADT_UPDT_DT,
         IND_UPDATE
    SELECT * FROM (
    SELECT      
         to_number(KOFAX.RECEIVED_TZ)     TZ_OFFSET,
         min(sysdate)     ADT_CRT_DT,
         min(sysdate)     ADT_UPDT_DT,
         'I' IND_UPDATE
    FROM     ESTG.FLAT_FIL_DMS_KOFAX KOFAX
    WHERE     (1=1)
    And (KOFAX.LD_DT = ( select MAX(LD_DT) from ESTG.FLAT_FIL_DMS_KOFAX INNER
    where INNER.ENGAGEMENT=KOFAX.ENGAGEMENT
                   and INNER.KOFAX_FILE_NM = KOFAX.KOFAX_FILE_NM
                   AND INNER.IM_CUST_ID = KOFAX.IM_CUST_ID
              and INNER.BATCH_ID=KOFAX.BATCH_ID)
    AND
    (TO_DATE(KOFAX.LD_DT)>=TO_DATE(SUBSTR('#WAREHOUSE.P_EDW_LAST_RUN',1,10),'YYYY-MM-DD'))
    And (substr(KOFAX.RECEIVED_TZ,1,1) <> '+')
    Group By to_number(KOFAX.RECEIVED_TZ)
    ) S
    WHERE NOT EXISTS (
         SELECT     'X'
         FROM     EDW.DCMT_TIMEZONE_LOOKUP T
         WHERE     T.TZ_OFFSET     = S.TZ_OFFSET AND
         )

    Easiest fix for you would be to change the detection_strategy on the IKM from NOT_EXISTS to either :
    MINUS
    -- Try this out, it should work, it will give the same data through the equiverlant steps.
    NONE
    -- This will load all incoming data into your I$ table, there will be more rows to crunch in the following 'Flag Rows for Update' step, it might give incorrect results potentially - you will have to test it.
    So try MINUS first, failing that, see if NONE gives you what you want in your target.
    Are you inserting only new data or updating existing data?

  • Where Not

    These both not returning same number, am i missing anything, I would like change the first query to write in other format, because i have lot of and conditions like this. I have given only one as example.
    -- Original query ; working
    SELECT COUNT(*) FROM P
    INNER JOIN R WITH ( NOLOCK )
    ON R.Id = P.Id
    where P.Pk NOT IN (
    SELECT p.Pk
    WHERE R.Name = 'S'
    AND p.Type = 'O' )
    and R.Date = '7/16/2014'
    -- Test query ; not returning same rows as above
    SELECT COUNT(*) FROM P
    INNER JOIN R WITH ( NOLOCK ) ON R.Id = P.Id
    where NOT (R.Name = 'S' AND p.Type = 'O')
    and R.Date = '7/16/2014'

    Those two statements will not return the same result if either R.Name or P.Type is NULL and R.Date = '7/16/2014'
    To see why that is true, consider the case where R.Name is NULL and P.Type = 'O'.
    The first query's inner select is Select p.Pk WHERE R.Name = 'S' AND p.Type = 'O'.  That will return zero rows because R.Name is NULL.  So the NOT IN will be TRUE and since the R.Date condition is TRUE so the entire where is true and that row is
    counted.
    In the second case, you check if R.Name = 'S'.  Since R.Name is NULL, the result of that logical comparison is UNKNOWN (that is, neither true nor false).  You then AND that with p.Type = 'O' which is TRUE.  So you get UNKNOWN AND TRUE - the
    result of that is UNKNOWN.  You then do a NOT of that UNKNOWN values which is still UNKNOWN.  You then and that with R.Date = '7/16/2014', so the final result of your where condition is UNKNOWN.  So this row is not counted.
    So the first and second queries can return different results.
    I gather from your question that you want a query using the form of the second query that will return the same result as the first query.  To do that you have to handle the NULL's.  One way would be to do
    SELECT COUNT(*) FROM P
    INNER JOIN R ON R.Id = P.Id
    where Not (IsNull(R.Name, 'S') <> 'S' And IsNull(p.Type, 'O') <> 'O')
    and R.Date = '7/16/2014'
    Tom

  • HOW TO SELECT ONLY THOSE RECORDS WHERE NOT AVAILABLE ON SECOND TABLE

    hi
    i have two tables one name is menus and second name is UGroupDetail. Actually i have created it for user role privileges for my application
    USE [LedgerDB]
    GO
    /****** Object: Table [dbo].[Menus] Script Date: 03/28/2015 13:45:27 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Menus](
    [RightID] [int] NOT NULL,
    [RightName] [nvarchar](200) NULL,
    [GroupID] [int] NULL,
    CONSTRAINT [PK_Menus] PRIMARY KEY CLUSTERED
    [RightID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    second table is
    USE [LedgerDB]
    GO
    /****** Object: Table [dbo].[UGroupDetail] Script Date: 03/28/2015 13:46:12 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[UGroupDetail](
    [RightID] [int] NOT NULL,
    [RightName] [nvarchar](200) NULL,
    [GroupID] [int] NULL
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[UGroupDetail] WITH CHECK ADD CONSTRAINT [FK_UGroupDetail_Menus] FOREIGN KEY([RightID])
    REFERENCES [dbo].[Menus] ([RightID])
    ON UPDATE CASCADE
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[UGroupDetail] CHECK CONSTRAINT [FK_UGroupDetail_Menus]
    GO
    ALTER TABLE [dbo].[UGroupDetail] WITH CHECK ADD CONSTRAINT [FK_UGroupDetail_UserGroup] FOREIGN KEY([GroupID])
    REFERENCES [dbo].[UserGroup] ([GroupID])
    ON UPDATE CASCADE
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[UGroupDetail] CHECK CONSTRAINT [FK_UGroupDetail_UserGroup]
    UGroupDetail have many groups as assigned to a new user but Menus table has only default groups which is 90 records
    Menus table is a primary table and UGroupDetail is a Foreign key table
    now i want to combined these tables and want to get only remaining records for each group
    for example i have assigned 5 roles to GroupID 2 and now when i apply select commands the result should be 85 out 90 for GroupID 2
    but i have not idea how to modify select query for get desired result

    I don't really understand the tables. What is GroupID doing in the Menues table? And what does an entry without a RightName mean? Shouldn't that column be NOT NULL?
    The UGroupDetail does not have any primary key. From your description, I would expect the PK to be (RightID, GroupID). But strangely enough, GroupID is nullable. So is RightName, but I think this column is redundant and should be removed.
    Anyway, if I understand your question correctly, you need something like:
    SELECT UG.Name, M.RightName
    FROM   UserGroups UG
    CROSS  JOIN Menus M
    WHERE  NOT EXISTS (SELECT *
                       FROM   UGroupDetail UGD
                       WHERE  UG.GroupID = UGD.GroupID
                         AND  UG.RightID = M.RightID)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Why can't i access my itunes anymore? whenever i click on it, it makes my laptop freeze/slow down to the point where not even ctrl alt delete works properly and i have to turn the laptop off and then back on to get anything done.

    why can't i access my itunes anymore? whenever i click on it, it makes my laptop freeze/slow down to the point where not even ctrl alt delete works properly and i have to turn the laptop off and then back on to get anything done. it has been this way for the last 2/3 days now and i have uninstalled and reinstalled it but it doesnt work

    Hello there, bobbiefromIRL.
    The following Knowledge Base article goes over some great steps for troubleshooting your issue:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • How to tell what methods where not used in the code?

    Hi there,
    I wonder if there's a way to check what method are not used in the execution code (void main).
    Example:
    in the code below, the following method where not used:
    setAge, getAge, getName,setName, addFeedback
    public class Test
         public static void main(String args[])
              Employee empl = new Employee("John", 54);
              System.out.println(empl.getDeatils());
    public class Employee
         private int age;
         private String name;
         public Employee(String name, int age)
              this.name=name;
              this.age=age;
         public String getDeatils()
              return name+" ("+age+")";
         public void addFeedback()
              //do something here.
         public int getAge()
              return age;
         public void setAge(int age)
              this.age = age;
         public String getName()
              return name;
         public void setName(String name)
              this.name = name;
    }

    Yucca wrote:
    georgemc wrote:
    Yucca wrote:
    Sound like you should visit the logging API or you could do SOP all over your code which would make it very unreadableI don't see why logging code will make his code any less messy than SOP everywhere. Unless you're talking about applying logging by AOP, which is equally messy in a different way.I never implied that the one was tidier than the other. O merely recommended my knowledge on how to help the OP and gave 2 choices. Oh right. It looked like you were suggesting SOP was messier somehow. Never mind, then.
    Besides is AOP really that bad when using Interceptors? I know that this is new to Java but interceptors are really not that untidy.I didn't say they were untidy. I didn't say there was anything wrong with AOP. But logging by AOP results in pretty useless, messy logs. "This method was called with these parameters" all over the place, rather than something nice and friendly. Remember, logging is more often read by support staff than developers, so while it might be obvious to you what "getLlama(200, 3)" means, it's probably garbage to the support bods.

  • Ipad frozen in off/on loop and will not reboot

    ipad frozen in off/on loop and will not reboot, tried accessing itunes but needs my code on the ipad which is frozen

    I Found a solution:
    this requires itunes, first plug the charger cable into the computer, then hold the home button on the iPad and plug the cable into the iPad, you should see the iTunes logo on the iPad. You will then receive prompts to restore. This assumes you backed up the device to iCloud prior to the problem.

  • Apple Loops Utility does not work at all for imported file

    I have imported an MP3 into Logic Pro 8, which converts it to an AIFF file, and am trying to configure the project to sync to that tracks tempo. From what I understand, I do this by opening it in the ALU and having it add tempo information to the file.
    My problem is that when I open the file in the ALU, and I have version 2.0.1, literally almost NOTHING works. I can hit the play/stop/jump to start buttons and they work. However, the volume control does nothing. Likewise, the Tempo slider as well as the transpose dropdown don't do anything.
    On the Transients tab, the Transient Division dropdown and Sensitivity slider are grayed out. Since I've never used this tool before, I would assume that this is how I get the utility to detect the beats in the song. The waveform view just shows the song waveform, with no markers as it does if I open an Apple Loop.
    If I switch to the Tags tab, ever single checkbox is grayed out. Finally, if I go to the file menu, all Save options are grayed out.
    My first thought, is of course, that I'm just an idiot and that I don't know what I'm doing. However, in searching the forum, I found this post from a year ago where someone is complaining about what seems to be the exact same problem, and they did not receive a single response.
    http://discussions.apple.com/thread.jspa?messageID=8516386&#8516386
    Any ideas on either how to get ALU to work or to get my project to sync to the MP3 without requiring the ALU?
    Thanks!
    Mark

    In case you are importing a whole track you won't get the results you are expecting with ALU....
    Under *File Type* in the Tags tab select Looping so that the Transients Division and the rest of the settings be active.
    Hope this helps
    A

Maybe you are looking for

  • Noisy phone line, here we go again......

    Hi, all, I'm new here, so please be gentle! We've been going round and round on this one for over a year, wonder if anyone has any new suggestions.... Basically, we have an intermittent crackle on our land line. Been going on for ages now. We've had

  • Reconstructing a string from a database retrieval

    What is the correct way to retrieve data such as a string from a database? If I inputing data to the database like this... std::string inputString = "hello world"; data.data = &inputString; data.size = inputString.size(); ret = dbp->put(dbp, NULL, &k

  • WorkBench New Process Created in ES4 invoke will throws below exception

    Error Occured while invoke new process  created from work bench server ES4. If we import process from ES2 to ES4 same process will working fine can any one help on the LOGGING INFORMATION ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException: Inv

  • Timeline playhead goes back to beginning when it hits end

    Is there a preference or something somewhere I need to turn off to prevent the playhead in the timeline from going back to the beginning of the timeline and start playing again from the beginning, after it plays through the entire timeline once and i

  • Sales Order Creation - User defined POV on Reason Code

    I need to change the F4 values list on a field on standard SAP screen.  Screen 4480, field ABGRU of SAPMV45A. There appears to be no customer exit in the process on value-request section of the screen that I can utilise. Can you advise on the best wa