UPDATE retrosheet.starting_pitcher_game_log AS b, Here is the code that worked: ALTER TABLE retrosheet.starting_pitcher_game_log ADD COLUMN Game_Date DATE the "Game_ID" column is there, and this is where I have been trying to extract the information from to create the Game_date column-the date is expressed between character numbers 4 through 11. above is a screenshot of the table contents view of the starting_pitcher_game_log table. Subin, With your changes, the query runs eery time, but it still leaves the Game_id column with "null" on each row of that column. View of sequel pro of MySQL database table in question "starting_pitcher_game_log" When I add "COLUMN" after "ADD", the query runs but only adds null values to the column. It gives an error: Unknown column 'starting_pitcher_game_log.Game_date' in 'field list'. INNER JOIN game ON game.GAME_ID = starting_pitcher_game_log.GAME_ID Then I put in your original code:ĪLTER TABLE starting_pitcher_game_log ADD Game_date INTEGER Update of status following Subin's code changes: Please let me know if you need additional information. Starting_pitcher_game_log.GAME_ID' at line 3Ĭan someone offer guidance on what's wrong with the code here? You have an error in your SQL syntax check the manual thatĬorresponds to your MySQL server version for the right syntax to use WHERE game.GAME_ID = starting_pitcher_game_log.GAME_ID This is my code: ALTER TABLE starting_pitcher_game_log ADD Game_date INTEGER In order to create this field, I have to extract and attach substrings from another field in this table called GAME_ID. I would like to create a new field called Game_date in the table starting_pitcher_game_log. I am using MySQL 5.6.26 with Sequel Pro on Mac OS X.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |