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…
Tag: sql
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 …
SqlClient.SqlException: Invalid column name ClassNameId While fetching data from Fluent API
I am new to this EF,I am tring to fetch data from Sql Db table, and it gives me error like invalid classNameId error. public class ClassName { [Key] [Display(Name = “Id:”)] …
How to insert data into a String array in postgres stored procedure
I have a pseudo stored procedure as given below: CREATE OR REPLACE FUNCTION get_data() RETURNS void AS $$ DECLARE rec_new RECORD; querystring TEXT[]; cursor_file CURSOR FOR …
Select data that wont expire in the next 60 days
I’m trying to select data that won’t expire in the next 60 days so far I have this $sql = “SELECT id FROM cooler WHERE expiry_date > CURDATE()”; which only shows data that has not expire.
Counting occurrences in SQL
I have following table structure: Student School Code Roll Number A 12 135 B 12 248 C 16 934 D 16 437 E …
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, …
Select only one row by more conditions
This query is supported by PostgreSQL but H2 can not run query because of Over(partition by) . Question is how to select only one row with latest created time for different values in 2 columns. …
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 …
How to trim all lowercase characters that comes before an uppercase character in a string using sql server
How can I write an SQL Server query to trim all lowercase characters that comes before the first uppercase character in a string? e.g. string value “eaplgCostPrice”, remove “eaplg” and pass “CostPrice”…