I have reviewed several posts here and can’t find the answer, but it may be that the problem and answer are a bit above my pay grade. I have an MSAccess Table with two ID fields (ID1 and ID2), and …
Tag: sql
Count and group data by Year/month and by user
I have a dataset that looks like this: GO CREATE TABLE [dbo].[taskDB]( [ticket] [varchar](50) NULL, [created] [date] NULL, [closed] [date] NULL, [rating] [varchar](50) NULL [user] […
MySql regexp on column with html
I have a table with HTML content in which I need to select all rows containing a span element with the CSS class “glyphicon glyphicon-film” with some text content, but exclude all rows …
Mark values with diffreent tag in sql
I have one endpoint that is 7. I would like to few numbers 40,35,30,26,22,18,12 mark as completed.(This is an example. The value may be different) and few numbers 13,17,21,27,32,38,43 mark as pending. (This is an example. The value may be different) Can we achieve by SQL statement? for number details, please …
Multiplying 2 column values in Dynamic SQL
This is giving the error message: Conversion failed when converting the varchar value ‘27.72081’ to data type int. Answer You’re casting numeric values to VARCHAR inside your dynamic statement. Remove the CASTs and it should be good. Your resulting statement should read something like this w…
How do I get the lates tm.detail_notes ( tm.detail_notes for max(tm.timeslip_date))?
I have a query that return some record, but I need to get whatever the latest tm.detail_notes on max(tm.timeslip_date). Right now I am getting an error. (I have multiple record dates on the table and each day have note) Query Error The text, next, and image data types cannot be compared or sorted, except when…
How can I add a row to my SQL results between each “category” change in the data?
I use SQL Server 2019 to produce a long list of shipping options. This list is produced by a simple query on a table containing the list items, and displayed on a handheld terminal. Users find it cumbersome and time-consuming to navigate the list to find the correct option, and must do so several times per da…
Getting NULL after combining strings between date functions
Given a date column with a value 2020-05-01, I want to return 2020-Q2. The QUARTER() function is not available due to the Hive version we are using. I can get the quarter number with: (INT((MONTH(yyyy_mm_dd)-1)/3)+1). When I try to combine this with the YEAR() function and strings, I get null: How can I prope…
How to convert time given as string into integer mins
What I’m trying to ask is that I’ve a table Duration. It has only one field elapsed and it is VARCHAR. The table is this: I want this table: total should be integer or number. I’ve to perform some arithmetic on it later. Here’s what I tried: Please help me. Note: I need MYSQL query not…
How do I query every person that does not know anyone that takes classes?
I’m struggling with the following SQL problem: I must query all persons that do not know anyone who takes classes, using the following tables: After a long time trying different queries, the following query is the closest I got to the desired result: I seem to get more results back than is necessary for…