This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

delete sql not working

 
bhavin ragha
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
trying to delete all information relating to cd005

im putting in the statement below. But i get the error: near ",": syntax error... (im using sqlite)

delete from cds, bands, band_members, releases
where band_members.band_id = bands.band_id
and band_members.band_id = releases.band_id
and cds.cd_id = releases.cd_id
and cds.cd_id = 'cd005'

when i change delete to select * i get the values that i want to delete.
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can only delete rows from one table using the SQL DELETE statement.
 
bhavin ragha
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:You can only delete rows from one table using the SQL DELETE statement.


so how do i delete all data relating to cd005
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One table at a time.
 
Saurabh Pillai
Ranch Hand
Posts: 524
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or if you are allowed to set cascade delete option.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic