Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15772

Mysql Nested sub query

$
0
0
Hi All

I need some help with a query in Mysql, which i would think that
a nested sub query would be required.
This is probably better understood with an example of what the output should
look like.
basically i need the query to run on a meter readings table and return
the last two readings in date order descending for each asset.

I hope that this makes senseName:  source_data_table.png
Views: 14
Size:  13.2 KBName:  output_query.png
Views: 14
Size:  6.6 KB

I hope i have attached the pics of the source data table and query ok.

Any assistance would be greatly appreciated
Attached Images
  

Viewing all articles
Browse latest Browse all 15772

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>