Skip to content

Instantly share code, notes, and snippets.

View tsmango's full-sized avatar

Tom Mango tsmango

View GitHub Profile
SELECT * FROM comments
WHERE thread_id LIKE BINARY '2A'
OR thread_id LIKE BINARY '2B'
OR thread_id LIKE BINARY '2C';
SELECT * FROM comments WHERE thread_id IN ('2A', '2B', '2C');
SELECT * FROM comments WHERE thread_id LIKE BINARY '2A';
SELECT * FROM comments WHERE thread_id = '2A';
(SELECT * FROM `users` WHERE (name = 'tom')) UNION (SELECT * FROM `users` WHERE (name = 'gary')) ORDER BY created_at;
User.union([{:conditions => ['name = ?', 'tom']}, {:conditions => ['name = ?', 'gary']}], {:order => 'created_at'})
ActiveRecord::Base.union(parts, options = {})
total 1133325 docs, 266596694 bytes
total 117.702 sec, 2265011.00 bytes/sec, 9628.75 docs/sec
xml.media(:content, :url => "some-image-url", :type => "image/jpeg")
xml.rss(:version => "2.0", "xmlns:media" => 'http://search.yahoo.com/mrss/')