List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:August 22 1999 11:51pm
Subject:Re: trailing comma in delete statement
View as plain text  
At 10:15 PM -0700 8/22/99, Mick Hanna wrote:
>im calling a loop like so:
>
>printf("%s,",rmid[i]);
>
>this will give me a string like so:
>
>10,5,7,22,55,100,
>
>the problem is the trailing comma....i just cant get rid of it.
>
>the delete statement i will use is
>
>delete from table where id in (string,)
>
>is just not going to work....
>
>maybe this question is not mysql orientated
>but it will be once i get it right :)


You have to know when you're printing the last item in your list,
and don't print the trailing comma when you reach that item.

-- 
Paul DuBois, paul@stripped
Thread
trailing comma in delete statementMick Hanna22 Aug
  • Re: trailing comma in delete statementMark Maggelet22 Aug
  • Re: trailing comma in delete statementJeff Urban22 Aug
    • Re: trailing comma in delete statementThimble Smith22 Aug
    • Re: trailing comma in delete statementScott Hess23 Aug
  • Re: trailing comma in delete statementPaul DuBois23 Aug
    • Re: trailing comma in delete statementDan Nelson23 Aug
      • Re: trailing comma in delete statementMichael Widenius27 Aug
Re: trailing comma in delete statementJesse22 Aug
  • Re: trailing comma in delete statementAlok K. Dhir22 Aug
Re: trailing comma in delete statementAnthony Mendoza23 Aug
  • Re: trailing comma in delete statementJames Manning23 Aug
Re: trailing comma in delete statementAnthony Mendoza23 Aug