SQL statment

Results 1 to 2 of 2

Thread: SQL statment

  1. #1
    Join Date
    Dec 1969

    Default SQL statment

    &nbsp;<BR>I have three tables and i want to delete the records from them . <BR><BR>i wrote this SQL statment can you help me incorrecting it please. <BR><BR>DELETE from users, u_prjmdl, u_link where users.userid = &#039;3&#039; <BR>AND users.userid = u_prjmdl.userid <BR>AND users.userid = u_link.userid

  2. #2
    Join Date
    Dec 1969

    Default Separate your statements sir

    Use one connection object but initiate 3 deletes, if you have dependencies make sure you do these in the right order:<BR><BR>DELETE from u_link where userid =&#039;3&#039;<BR>DELETE from u_prjmdl where userid = &#039;3&#039; <BR>DELETE from users where userid = &#039;3&#039; <BR><BR>I can&#039;t tell by your table names what order you should do this in, I&#039;d guess users is last but I&#039;m not sure what your first two are.<BR><BR>Also are you sure your userid is text? If it&#039;s numeric ommit the single quotes from the value you&#039;re passing, IE:<BR>DELETE from users where userid = 3 <BR><BR>

Posting Permissions

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