Guest User

Untitled

a guest
Aug 14th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. mysql string split
  2. SELECT SUM(amt) FROM table1 WHERE id in (114,116) and another_id = 10;
  3.  
  4. result is 10+20 = 30
  5.  
  6. SELECT SUM(amt) FROM table1 WHERE id in (REPLACE("116,114",'"',"")) and another_id = 10;
  7.  
  8. result is 10
  9.  
  10. WHERE CONCAT('%,', id, ',%') LIKE ('${submitted_string}')
  11.  
  12. SELECT SUM(amt) FROM table1 WHERE ","+CAST(id AS CHAR)+"," in (","+"116,114"+",")
  13. and another_id = 10;
Add Comment
Please, Sign In to add comment