Skip to content

Tag: sql

Loop through SQL query using variable from another table

I have two tables file & users, I want to see the file info for each user for C:Users%USERNAME%Documents So e.g. this would get the info from ‘example’ documents: But the username is coming from the users returns Alternatively, there’s: Which provides the first part of the path, but stil…

Need to filter data

I have a table ldgr with following fields Vchrno date debit credit amount JV1 01-mar-19 BA11 0 100 JV1 01-mar-19 0 PE113 100 JV1 01-mar-19 BA33 0 …

How to fix H2 Syntax error in SQL statement?

I asked earlier today about replacing a window function because H2 does not support it. I rewrote SQL query but every time I get syntax error in the SQL query (posted below) expected “UNION, …

Casting to a decimal in SQL

The max value in my table for measure_rate is 572. The below query returns that value. SELECT cast(max(measure_rate) as decimal) FROM [SurgicalMeasures] WHERE measure_rate != ‘N/a’ and …