Welcome to Sign in | Help

Re: CASE in WHERE

  •  07-03-2008, 12:32 PM

    Re: CASE in WHERE

    Sau altă variantă (ceva mai eficientă decât cea a lui Andrei şi probabil mai aproape de rezultatul dorit):

    select * from tabel
    where USER_NAME() = 'user1' and utilizator in ('user1', 'user2')
    or USER_NAME() = 'user2' and utilizator in ('user3', 'user2')
    or USER_NAME() not in ('user1','user2') and utilizator = USER_NAME()

    Răzvan
View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems