Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Sintassi multidelete

  1. #1

    Sintassi multidelete

    Semplicissimo, se eseguo questa query:
    DELETE from db.post as p using archivio.post as a where a.postid = p.postid

    Mi da questo errore "#1109 - Unknown table 'post' in MULTI DELETE" (e ovviamente sono certo che la tabella post esiste in entrambi i db)

    Se uso quest'altra:
    DELETE from db.post as p, archivio.post as a where a.postid = p.postid

    Mi dice
    Codice PHP:
    #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 'where a.postid = p.postid' at line 1 
    Ma dove sta quest'errore di sintassi?


    Versione MySQL client: 5.0.21


    Grazie per l'aiuto!

  2. #2
    con il DELETE non si devono usare alias.

    la sintassi e'

    codice:
    delete tab1
    from tab1, tab2
    where condizioni...

    Il silenzio è spesso la cosa migliore. Pensa ... è gratis.

  3. #3
    grazie mille, gentilissimo

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.