Stored procedures

  • How do i write the sp to compare 3 parameters?

  • Could you elaborate a bit further as to whats ur exact requirement


    Kindest Regards,

    Sureshkumar Ramakrishnan

  • We have about 15 parameters of which 3 are Floor, Suite and Room. The requirement is like this-

     

    If the region is east, we have to combine the three parameters Floor,Suite and Room and compare it with Floor.

    If the region is west, we have to compare Floor with Floor, Suite with Suite and Room with Room.

  • "combine the three parameters Floor,Suite and Room and compare it with Floor" how do you combine the 3 params ? You need to post more details go get a solution imo


    Kindest Regards,

    Vasc

  • Maybe something like this:

    select *

    from tblname

    where

    floor =

     case

      when region='east' then ('floor'+'suite'+'room')

      when region = 'west' then 'floor'

     end

    and suite =

     case when region = 'west' then 'suite'

      when region = 'east' then ''

     end

    and room =

     case when region = 'west' then 'room'

      when region = 'east' then ''

     end

  • Thanks

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply