Skip to content
Advertisement

Tag: database

I want to join two tables, removing duplicate values

I have to say I’m an amateur on MySQL, plus english is not my mother’s language. Here is my first table “Teacher”: And here my second table “Course”: I would like to know which country has more teachers giving courses, but I don’t want that it count the same teacher twice. So far I made this: When I run this,

how to merge multiple rows into single in MSSQL

this is my data: id segment country product status month year 83916512 Government Null Null Null Null 2014 83916512 Null Germany Null Null Null 2014 83916512 Null Null Carretera Null Null 2014 83916512 Null Null Null completed Null 2014 83916512 Null Null Null Null June 2014 83916512 Null Null Null Null Null 2014 i want below output can anybody help

Convert day of week name to day of week number Vertica

With this way – SELECT TO_CHAR(NOW(), ‘DAY’); I can get a day of week name(E.G. MONDAY). With SELECT dayofweek(NOW()); I can get the number of the day of week. (E.G 1) QUESTION: How to convert day of week name to day of week number. (E.G MONDAY -> 1) SMTH like TO_NUMBER(‘MONDAY’, ‘DAY’); –> 1 (just for example, don’t working) Answer

Does SQLite support character range with [ ]?

I’m trying to use Northwind version in SQLite (someone posted it on Github and it’s super handy), but my query for selecting employees with last name starting with B, C, D, …, L using LIKE returns empty table: The table contains such names (most of them, in fact). Does SQLite not support character range in LIKE with []? Answer SQLite

Advertisement