I have the following query, that when it is run gives the following error: Conversion failed when converting the nvarchar value ‘247.300’ to data type int. The query is as follows: SELECT UD….
SQL Statement // between with datetime
I have following query: select s.ScreenID, s.ScreenName, ps.ScheduleDate from Screens s left join PerformanceSchedules ps on ps.ScreenID = s.ScreenID where s.TheatreID = 2 and ((ps.ScheduleDate not …
SQL Select parent as column name and child as value
I am creating a database to store music. There are different categories that each have sub categories. Example: id name parentID 1 instrumentation null 2 …
What is the best way to compare a name field with a string value?
I have a query that compares a string value against a name field in my database. The structure of the name field in the DB is not consistent, it could be any of these: John Doe Doe John Doe, John My …
Database Query to generate a Time-based Chart
I have a logins table in the following (simplified) structure: Now I want to generate chart like this: https://prnt.sc/mifz6y Basically I want to show the logins within the past 48 hours. My current query: This works as long as there are entries for every hour. However, if in some hour there were no logins, t…
SQL join condition either A or B but not both A and B
I have sales data by years and quarters and for the last year I want to fill missing quarters with last available value. Say we have source table: +——+———+——-+——–+ | year | …
SQLAlchemy how to group_by relation?
Here are the models: class User(Base): __tablename__ = ‘users’ id = Column(CHAR, primary_key=True) first_name = Column(CHAR) last_name = Column(CHAR) email = Column(CHAR) …
How to INNER JOIN only one row from second table
I have a issue joining only one row from the second table statement: SELECT ART.*, EAN.* FROM ART,EAN WHERE ART.ARTNR = ean.unit_artnr AND ean.typ = ‘LE4’; TABLE EAN has sometimes 2 …
Search area in Jquery for searching in a grid of input from another input
I wish to search from an input (type=”text”) in a grid (like table but made in .css for be responsive so with div ans span in html) if input (type=”text”). (I precise than this grid in imported from …
Selecting data from 3 linked tables
I have three table review_form_languages, review_form_translations and rate_params. rate_params -> id, label review_form_languages -> id, name review_form_translations -> id, rate_params_id, …