Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    41

    Create view query not working for both mysql4 and 5

    hi, on my PC I have mysql-5.0.27 and this query successfully creates a view

    Code:
    CREATE VIEW `clipping`.`mysec` AS SELECT 
    
    `clipping`.`clip`.`article` AS  `article` , 
    
    `clipping`.`subject`.`subject` AS  `subject` , 
    
    `clipping`.`clip`.`clipid` AS  `clipid` , 
    
    `clipping`.`author`.`author` AS `author`
    FROM (
    `clipping`.`clip`
    JOIN `clipping`.`author` ON (
    (
    `clipping`.`clip`.`authorid` = `clipping`.`author`.`authorid`))
    JOIN `clipping`.`subject` ON (
    (
    `clipping`.`clip`.`subjectid` = `clipping`.`subject`.`subjectid`)
    )
    )
    but when i run same query on same database at my server with mysql 4.1.22-standard it returns error

    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VIEW `clipping`.`mysec` AS SELECT

    `clipping`.`clip`.`article` AS `article` ' at line 1
    Post2Host Community
    Cpanel hosting upto 10GB & adfree .
    spacesocket.com

  2. #2
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    http://dev.mysql.com/doc/refman/5.0/en/create-view.html
    The CREATE VIEW statement creates a new view, or replaces an existing one if the OR REPLACE clause is given. This statement was added in MySQL 5.0.1
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  3. #3
    Join Date
    Apr 2004
    Posts
    41
    ahh!
    can someone help me to change this query to create a new table instead of view
    Post2Host Community
    Cpanel hosting upto 10GB & adfree .
    spacesocket.com

  4. #4
    Join Date
    Apr 2004
    Posts
    41
    thanks I have created a new table instead of view
    Post2Host Community
    Cpanel hosting upto 10GB & adfree .
    spacesocket.com

Posting Permissions

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