Solved

Manipulating Query through industrial sql

Posted on 1998-03-24
2
970 Views
Last Modified: 2008-02-01
Using Wonderware's industrial sql server (MS SQL server embedded), how can we change the output format of a query result.  When we run the following query

SELECT value, datetime, tagname
FROM history
WHERE tagname = 'temperature1'
AND DateTime > '24 Mar 1998 05:00'

we get a column of "temperature1" (column name is tagname) and a column of the actual temperatures (column name is value).  We want 1 column named temperature1 with all the values.  Additionally the AS syntax does not work, nor does the CASE statement.  Wonderware has been very little help.








 
0
Comment
Question by:rivercem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
spiridonov earned 100 total points
ID: 1090856
Do not include column with 'tagname' name in select list , if you wnat only temperature values type 'SELECT value FROM...', if you also want 'datetime' column use 'SELECT value,dateime FROM...'
You do not need to put field into select statement to use it in the WHERE clause
0
 
LVL 5

Expert Comment

by:perezjos
ID: 1090857
If you want all the values of tagname = 'temperature1'
try this query.

SELECT value as 'Temperature1'
FROM history
WHERE tagname = 'temperature1'
AND DateTime > '24 Mar 1998 05:00'
if you want all the values dont check the tagname.

0

Featured Post

ClickHouse in a General Analytical Workload

We have mentioned ClickHouse in some recent posts, where it showed excellent results.

In this article on Experts Exchange, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question