0

In the following, there are two IF checks that dispatch to the same table_a:

SET @first = substr(new.data, 1, 1);

IF @first = 0x15 THEN

    INSERT INTO table_a (    
        id,
        time,
        data
    ) VALUES (
        new.id,
        new.time,            
        new.data
    );

ELSEIF @first = 0x16 THEN 

    INSERT INTO table_a ( 
        id,
        time,
        data
    ) VALUES (
        new.id,
        new.time,            
        new.data
    );

Is it, instead, possible to write something like?

IF @first = 0x15 | 0x16 THEN
    INSERT INTO table_a (    
        id,
        time,
        data
    ) VALUES (
        new.id,
        new.time,            
        new.data
    );
KcFnMi
  • 5,516
  • 10
  • 62
  • 136

0 Answers0