cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

ThingWorx SQL Query

PSB
6-Contributor
6-Contributor

ThingWorx SQL Query

Hi all,

 

I have to run a query on MS SQL Database table, which has columns with spaces in their names (ex: 'SA03 LH CS BRG DEPTH (mm)').

How do I query this successfully?

Here is an example query:

 

SELECT *

FROM <<tableName>>

WHERE <<tagName>> != 0;

 

Here <<tagName>> is a column with space in its name.

 

-PSB
1 ACCEPTED SOLUTION

Accepted Solutions
Arun_C
16-Pearl
(To:PSB)

Hi @PSB ,

 

I have tried in MS SQL DB. Kindly find the below atttached snapshot for your references.

Arun_C_0-1716274835044.png

Thanks & Regards,

Arun C

 

 

View solution in original post

3 REPLIES 3
Arun_C
16-Pearl
(To:PSB)

Hi @PSB ,

 

I have tried with PostgreSQL Query. It is working for me.

SELECT * FROM public.accounts where "SA03 LH CS BRG DEPTH (mm)" = 1

 

Arun_C_0-1716216775516.png

Thanks & Regards,

Arun C

 

PSB
6-Contributor
6-Contributor
(To:Arun_C)

Hi @Arun_C ,

 

PFA screenshot, I have tried it on MS SQL it doesn't seem to be working.

Screenshot 2024-05-21 100135.pngScreenshot 2024-05-21 102027.png

 

Can you try it on MS SQL & let me know.

 

-PSB
Arun_C
16-Pearl
(To:PSB)

Hi @PSB ,

 

I have tried in MS SQL DB. Kindly find the below atttached snapshot for your references.

Arun_C_0-1716274835044.png

Thanks & Regards,

Arun C

 

 

Top Tags