Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
mysql> select * from postcodes where postcode = "SW11 3NG" and address_1 REGEXP '6(\s|$)'; +----------+----------+----------+--------------+--------------+-----------------+-----------------+------------+-----------------------+--------------+----------+-------------+--------+------------------+-----------+-----------------+-----------------------+-----------+-----------+-----------+-----------+ | id | postcode | dps_code | organisation | sub_building | building_name | building_number | dep_street | street | dep_location | locality | postal_town | county | full_county_name | address_1 | address_2 | address_3 | address_4 | address_5 | address_6 | address_7 | +----------+----------+----------+--------------+--------------+-----------------+-----------------+------------+-----------------------+--------------+----------+-------------+--------+------------------+-----------+-----------------+-----------------------+-----------+-----------+-----------+-----------+ | 24013360 | SW11 3NG | 4S | | FLAT 76 | SELWORTHY HOUSE | | | BATTERSEA CHURCH ROAD | | | LONDON | LONDON | LONDON | Flat 76 | Selworthy House | Battersea Church Road | LONDON | | | | | 24013371 | SW11 3NG | 4D | | FLAT 66 | SELWORTHY HOUSE | | | BATTERSEA CHURCH ROAD | | | LONDON | LONDON | LONDON | Flat 66 | Selworthy House | Battersea Church Road | LONDON | | | | | 24013378 | SW11 3NG | 3U | | FLAT 6 | SELWORTHY HOUSE | | | BATTERSEA CHURCH ROAD | | | LONDON | LONDON | LONDON | Flat 6 | Selworthy House | Battersea Church Road | LONDON | | | | | 24013382 | SW11 3NG | 3Q | | FLAT 56 | SELWORTHY HOUSE | | | BATTERSEA CHURCH ROAD | | | LONDON | LONDON | LONDON | Flat 56 | Selworthy House | Battersea Church Road | LONDON | | | | | 24013393 | SW11 3NG | 3A | | FLAT 46 | SELWORTHY HOUSE | | | BATTERSEA CHURCH ROAD | | | LONDON | LONDON | LONDON | Flat 46 | Selworthy House | Battersea Church Road | LONDON | | | | | 24013404 | SW11 3NG | 2N | | FLAT 36 | SELWORTHY HOUSE | | | BATTERSEA CHURCH ROAD | | | LONDON | LONDON | LONDON | Flat 36 | Selworthy House | Battersea Church Road | LONDON | | | | | 24013415 | SW11 3NG | 1Y | | FLAT 26 | SELWORTHY HOUSE | | | BATTERSEA CHURCH ROAD | | | LONDON | LONDON | LONDON | Flat 26 | Selworthy House | Battersea Church Road | LONDON | | | | | 24013426 | SW11 3NG | 1J | | FLAT 16 | SELWORTHY HOUSE | | | BATTERSEA CHURCH ROAD | | | LONDON | LONDON | LONDON | Flat 16 | Selworthy House | Battersea Church Road | LONDON | | | | +----------+----------+----------+--------------+--------------+-----------------+-----------------+------------+-----------------------+--------------+----------+-------------+--------+------------------+-----------+-----------------+-----------------------+-----------+-----------+-----------+-----------+ 8 rows in set (0.00 sec) mysql> select * from postcodes where postcode = "SW11 3NG" and address_1 REGEXP '(\s|^)6(\s|$)'; Empty set (0.01 sec) mysql> select * from postcodes where postcode = "SW11 3NG" and address_1 LIKE '% 6 %'; Empty set (0.03 sec) mysql> select * from postcodes where postcode = "SW11 3NG" and address_1 REGEXP '(^|\s)6(\s|$)'; Empty set (0.01 sec) mysql> select * from postcodes where postcode = "SW11 3NG" and address_1 REGEXP '6\D'; Empty set (0.01 sec) mysql>
From the Design Piracy series on my blog: