Skip to content

Display the first and last day of a (calendar) week

In my database I have a table with consecutive dates. I group all dates to calendar weeks and display them in a table in my CSS. Now i want to display also the first and the last day of the calendar …

SQLite Insert Distinct from 2 variables

I have a SQLite DB with a table with the following kind of data: What I need to do is take columns B and C, create a single unduplicated list and autoincrement the primary key for the unique values. It needs to check to make sure an entry is not already existing – so the second table would be: I

How can I show values with zero in a Group By query

I am trying to get the zero values from my status table associated with the case of one user. So, I have this query that returns me only one value because, I have only one case associated with one status but I want to receive also the another status with value 0. So I have the status ‘Open’ and &#…

SQL Query creation with multiple joins

I am working with MYSQL, and want to create a query. I have 3 tables. QUESTION QUESTION_NUMBER QUESTION_DESCRIPTION 1 anydesc 2 anydesc2 ANSWER ANSWER_NUMBER ANSWER_DESCRIPTION 1 anydescANS 2 anydesc2ANS 3 anydesc3ANS And a bridge TABLE QUESTION_ANSWER Q_NUM A_NUM 1 1 2 2 2 3 Now I want to retrieve all the An…

SQL replace and insert Into

I have this table “NamesTable” in SQL Server. I want to insert and replace in a second column the corresponding name like this This is my query: The query runs and replace the selected words, but do not insert into my existing table. What I am doing wrong? Answer No idea what is the objective of y…

How to Further Group Items in a Column After Group By

I have an SQL table named “DATA” as follows: I’m attempting to return the following 3 columns: plan, planCount, totalCostPerPlan I’ve been working a query to return this and so far it looks like this: It sort of works, however, I get the data only partially grouped as follows: (The tab…