Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,453
Community Members
 
Community Events
165
Community Groups

How to repalce a string with specific format by SQL

Edited

I would like to change some specific string to a specific format like "line break" or "bullet" or "color text".

 

Example:

Original Table:

WWMemberHighlight
WW25MemAGREEN || ProjectA || Description-A
WW25MemBRED || ProjectB || Description-B

 

SQL Expected result:

WWMemberHighlight
WW25MemA

GREEN

  • ProjectA
    • Description-A
WW25MemB

RED

  • ProjectB
    • Description-B

 

Experimental but cannot work as expected:

  • REPLACE(T1.'Highlight',"||",FORMATWIKI("\n"+ "* " + "\n") ) as 'Hightlight-formated'

 

continuous following up from this question:

how to merge row cell by SQL

 

Thanks

1 answer

1 accepted

Hi @huangbin chen ,

We can suggest the following SQL query for your table:

SELECT *,
FORMATWIKI(REPLACE(T1.'Highlight',"||", "\n"+ "* " + "\n")) as 'Hightlight-formated'
FROM T*

Tue 5-1.png

I'm afraid that the multiple-level bullets that are shown on your screenshot are not possible to implement.

Thanks @Katerina Kovriga _Stiltsoft_ ,

Is is possible to have "color text" or "bold type" at specific separate char?

Source Example: Green || Project A >> Description-A

Expected result:

Green

  • Project A
  • Description-A

Or even mark "Green" as with color green.

The FORMATWIKI function works with the contents of the cell as a whole unit: you can color/make bold all the text but not specific strings (that are also different for every cell).

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you