this post was submitted on 03 Aug 2023
-3 points (40.0% liked)

Technology

59201 readers
2691 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
 

I'm not sure where to post the code, I don't want to make anyone irritated, but I need legit help with my SQL. Is this the right place? If not, what is the right community?

top 9 comments
sorted by: hot top controversial new old
[–] glad_cat@lemmy.sdf.org 10 points 1 year ago
[–] jet@hackertalks.com 6 points 1 year ago (1 children)

Your here now already, ask your question.

[–] newbeni@lemmy.world 1 points 1 year ago

I didn't know which post to reply to, so here goes: with one as (select top 1 field1, replace(field2_html,'''"]|([''"]).?\1)*>', '') as comments_html, field3, field4, field5, field6, field7, field8 from tablea where comments_html !=' '),

two as (select field1, field2 as html_clean, charindex('<',field2_html) as a, charindex('>',field2_html) as b, field3, field4, field5, fied6, field7, field8
from one)

select * into #temp8 from two

create table #RUdestinationtable (field1 int, comments_2 varchar(max), field3 varchar(300), field4 varchar(50), field5 varchar(300), field6 varchar(300), field7 varchar(300), field8 varchar(150))

while (select count(1) from #temp8 where substring(html_clean,a,b) is not null)>0 begin insert into #RUdestinationtable select distinct field1,replace(html_clean, substring(html_clean,a,b),'') as comments_2,field3, field4, field5, field6, field7, field8 from #temp8 end

select * fromRUdestinationtable

[–] beeb@lemm.ee 4 points 1 year ago (1 children)
[–] BrownianMotion@lemmy.world 2 points 1 year ago (1 children)

The mantra from IRC and all over the internet for decades!

Don't ask to ask, just ask. If its the wrong place, you'll be told.

[–] jet@hackertalks.com 3 points 1 year ago* (last edited 1 year ago)

I worked in a place with an internal chat program. Some people would just say "hello", waiting for you to respond before they ask their question.

Of course you're not going to respond to that until you know what they want. So you just don't respond cuz there's nothing to say. Oh the fun we had.

I'm now an official expert in " waiting for people to send the second message after hello "

[–] WontonSoup@lemmy.ml 4 points 1 year ago* (last edited 1 year ago)

Ask away but we’re likely going to need to see the table structure unless it’s really generic

Edit: forgot a

[–] BrownianMotion@lemmy.world 2 points 1 year ago

This is not the place. You want to find a place specific in coding or sql.

Did you try searching all communities for sql?