Skip to content
Advertisement

Ignore hash character in a query on sqlplus

i’ve launched this query on sql developer without error. insert into COMUNICAZIONI_TEMPLATE (ID, DESCRIZIONE, TESTO_TEMPLATE) values (3, ‘TEMPLATE EMAIL NUOVO DOCUMENTO’, ‘Gentile <…

Syntax issue with UPDATE query using WHERE and LIKE

I am trying to update an empty field in my table to show “Spray Guns Service Kit” if the product code field has “ASPASK” in it. This is what I have tried thus far: Access keeps telling me I am updating 0 rows when I should be updating 100s. However, when I change the code to it works but only

SQL count when equation of two columns are true

I have a sheet with rows (id and year). See below: id year 101 2002 101 2006 101 2010 101 2014 101 2018 102 2002 102 2006 102 2010 102 2014 103 2010 I simply want to regroup and reformat my table to look like this: id 2002 2006 2010 2014 2018 101 1 1 1 1 1 102 1

Select if date is older than 30 days. What to do if format is wrong?

I want to select all entries where the column “date” is older than 30 days. The problem is, that I dont have the date saved in a supported format. My date is saved as ‘DD.MM.YYYY hh:mm:ss’. Is there a way to get such a selection within sqlite without changing the give database? Or is my only or better option to

SQL join two tables by modifying on columns

I have 3 tables on PostgreSQL: SPENDINGS: STORE: CUSTOMER: I would love to join these tables like this: How can I do that could you help me out please? Answer trim(store.zip_code) is not good for the job because the whitespace is within the zip code text. Use replace(store.zip_code, ‘ ‘, ”) instead. right(spendings.store, 6) does not seem safe to me

Inserting multiple rows of data into a single column

Absolute SQL beginner here: I have a table ‘students’ with the columns ‘id'(primary key), ‘name’ and ‘mark’. I am now trying to add the marks for a number of students. Just using multiple UPDATE statements like seems rather dull and labor intensive. What would be the most simple and elegant way to execute such an operation using MS SQL? Answer

Join Only Unique Values From 2 Tables

I’m trying to join two MySQL tables, and return only the unique values between them. eg. I want to get as my result a table that only shows the intersections of rows without any duplicates where I’m joining on table1.column1 = table2.column1: Simple joins and unions and I’m ok, but this one is causing me a headache. Edit for clarification:

Advertisement