Showing posts with label monitor. Show all posts
Showing posts with label monitor. Show all posts

Wednesday, March 7, 2012

Obtaining the last record

Let's say I need to be able to dynamically retrieve the last record in a table (ChData) in order to be able to continuously monitor the flow of data. Since theoretically there is no such thing defined in SQL, let's say I have an index column - ChTimestamp - (which, for some odd reason, is a DOUBLE), which grows monotonically. Thus, I want the row with the largest ChTimestamp value. The data columns would be Ch0, Ch1, and so on. Let's also assume that for some reason I am limited to using the LabVIEW database connectivity toolkit and because of that, I don't have full use of the SELECT statement but I have to supply the table and column names for the "SELECT FROM " and only the WHERE and the like predicates can be freely specified (I don't know how freely). What would be an elegant query to achieve the desired result? Thanks!
Kamenelegant query to achieve your result:select phonenumber
from dbms_vendors
where dbms in ('sql server','oracle','mysql','postgresql','sybase','db 2')
sorry, couldn't help it

:cool:|||select * from chdata
where
chtimestamp=(select max(chtimestamp) from chdata)

or am I missing something?

Alternatively you could write a trigger to update a known row in another version of the table with a single row so you can have a simpler where clause.

select * from mystupidtable where x='1'|||SELECT TOP 1 * FROM Table1 ORDER BY chTimestamp DESC|||Thank you very much, LoztInSpace and Peso. No it's not a homework, I'm a professional, it's just that I have to deal with so many different technologies, programming languages, APIs, etc., that sometimes it's just easier (not to mention quicker) to ask those who deal with it every day instead of trying to jump start my fried brain. :o

Kamen :angel:|||Maybe it is time to make your niche?|||Actually, small companies appreciate multivalent engineers like me. Plus, I'm too old to change. :cool:
Kamen

Obtaining Hotfix

We're experiencing the problem describe in MS Knowledge
Base Article - 812915 "Performance monitor shared memory
setup failed: -1" error message when you start SQL
Server. The article states there is a support hotfix
available through Microsoft Product Support Services.
We're currently evaulating SQL server so we're using the
Enterprise Evaluation Edition. We like to obtain the
hotfix ( preferably for free ), but since we have
evaluation edition we don't know how to go about this.
Can we get the hotfix?
(a) I don't think you can apply patches and hotfixes to the evaluation
edition, but I'm not 100% positive. Did you install the latest release of
the evaluation edition, or have you been running it for a while?
(b) you can't just bypass product support and download a hotfix "for
free"... if it's a bug, and you can demonstrate to PSS that you are affected
by it, then you will be provided the file and refunded the cost of the call.
http://www.aspfaq.com/
(Reverse address to reply.)
"J" <anonymous@.discussions.microsoft.com> wrote in message
news:886b01c49606$7e287f90$a501280a@.phx.gbl...
> We're experiencing the problem describe in MS Knowledge
> Base Article - 812915 "Performance monitor shared memory
> setup failed: -1" error message when you start SQL
> Server. The article states there is a support hotfix
> available through Microsoft Product Support Services.
> We're currently evaulating SQL server so we're using the
> Enterprise Evaluation Edition. We like to obtain the
> hotfix ( preferably for free ), but since we have
> evaluation edition we don't know how to go about this.
> Can we get the hotfix?