-3

I have a SQL table with multiple columns and records. What i want is to count how many commas in the specific column (FROM) then place the counted comma in the next (ANSWER) column.

Sample

ID FROM ANSWER NAME STATUS LINE 1 aaa,bbb,ccc,DDD 4 OK
2 ccc,dd,cd,ab,cs 5 OK

I Hope someone can help me with this.

  • There are many different ways to do this. Using google came up with a ton of different solutions. maybe something like this https://stackoverflow.com/questions/5193893/count-specific-character-occurrences-in-a-string – Hursey May 17 '22 at 01:39
  • You have tagged this question VB.NET but not SQL, so the fact that it's a database table is irrelevant. In VB, it's a `String`. Your question is how to count how many of a particular character in a `String` in VB.NET. That's not something you need to ask. – John May 17 '22 at 01:43
  • Im sorry i already edit it thanks for reminding sir john – MelDel Music Whisper May 17 '22 at 01:48
  • @John sir do you have ideas how to do it using sql query? – MelDel Music Whisper May 17 '22 at 01:52
  • If this is now a SQL question, you should remove the VB.NET tag. Also, the sql-query-store tag is not relevant to this question. Please read the descriptions of a tag before adding it and do not add any that do not specifically apply. – John May 17 '22 at 02:59

0 Answers0