SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Sep 2010
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create a field in table1

    I can create a database and a table in MySQL but I do not know how to create a field in table1.

    When creating it (in MySQL) also how do you insert it after a certain field already programmed in?

    Also how to rename a field already existing?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,251
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Philosophaie View Post
    ... I do not know how to create a field in table1.
    ALTER TABLE... ADD COLUMN ...


    Quote Originally Posted by Philosophaie View Post
    When creating it (in MySQL) also how do you insert it after a certain field already programmed in?
    ALTER TABLE ... ADD COLUMN ... AFTER ...


    Quote Originally Posted by Philosophaie View Post
    Also how to rename a field already existing?
    ALTER TABLE ... CHANGE COLUMN ...
    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
  •