SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    UPDATE query MADNESS!!!! HELP!

    This is my query:

    UPDATE `methane`.`planning` SET `mz`=1 WHERE `import_date`='5/10/2011 12:00:00 AM' AND `lng`='-118.291' AND `lat`='34.0618';

    import_date is a VARCAHR(1024);
    mz is a BOOLEAN
    lat & lng are FLOAT

    If I go into MySQL Workbench and find that record it looks like this:

    '248', '05/05/2011', 'ZA-2011-1137-ZV-ZAA-SPR', '3150 W WILSHIRE BLVD 90010', '10', 'Wilshire', 'CONTRUCTION OF A NEW MIX USED PROJECT INCLUDING 2 HIGH RISE TOWERS WITH GROUND FLOOR RETAIL PUBLIC 11860 OPEN SPACE AND 913 PARKING SPACES 464 APARTMENT UNITS 41000 SQ. FT. RETAIL SPACE.', 'ZV-ZONE VARIANCE ZAA-AREAHEIGHTYARDAND BUILDING LINE ADJMNTS < 20% (SLIGHT MODIFICATIONS) SPR-SITE PLAN REVIEW', 'KACY KEYS (323)857-5546', '5/10/2011 12:00:00 AM', '34.0618', '-118.291', NULL

    THIS UPDATE WILL NOT UPDATE ANYTHING AT ALL. IT DOES NOT SET MZ TO 1 AND IT IS DRIVING ME MAD!!!!! PLEASE HELP!!!!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    please go back to mysql workbench and run the following query:
    Code:
    SELECT COUNT(*) AS rows
         , COUNT(CASE WHEN mz=1
                      THEN 'ok' ELSE NULL END) AS mz_1
         , COUNT(CASE WHEN import_date='5/10/2011 12:00:00 AM'
                      THEN 'ok' ELSE NULL END) AS import_dates
         , COUNT(CASE WHEN lng='-118.291' AND lat='34.0618'
                      THEN 'ok' ELSE NULL END) AS lat_long
         , COUNT(CASE WHEN mz=1
                       AND import_date='5/10/2011 12:00:00 AM'
                       AND lng='-118.291' AND lat='34.0618'
                      THEN 'ok' ELSE NULL END) AS all_conditions
      FROM methane.planning
    do the results tell you anything?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •