36
nitwhiz
6y

SQL gives me a hard on right now.

Two tables, 954 rows and 9414, connected via foreign keys and shit.

SELECT a_id,name,shit FROM table1 a JOIN table2 b ON a.id = b.a_id WHERE ((lower(name) LIKE '%lorem%') OR MATCH(name) AGAINST('lorem' WITH QUERY EXPANSION) OR name SOUNDS LIKE 'lorem')

and you got fuzzy search with resolved keys to another table in 0.047 sec, fuck me dude.

Comments
  • 11
    Sure, SQL is darn fast! It's a valuable tool wich always pays out to learn.
  • 5
    @Wombat Abso-fucken-lutely. I used to do stuff like that the `SELECT * FROM shit` and then process it further way, but for fucks sake using SQL to filter data further right in the database is a fucken bless.<3
  • 5
    @nitwhiz could not agree more. I really enjoy building well designed queries.
  • 1
    Wow, I didn't expect SQL to have a SOUNDS LIKE operator. The more you know.
  • 2
    Interesting! May have to look into this a bit
Add Comment