Skip to content

Filter out records that are not in this date format oracle

How do i filter records that can only be converted to date using to_date(’31-May-2019 00:00:00′, ‘DD-MON-YYYY HH24:MI:SS’) from the above sample query i am expecting results below how do i achieve this in oracle. Reason why i want to do this: i am receiving raw data and loading it to a…

Select columns based on condition in Snowflake

I am trying to find a solution to select columns in Snowflake based on a condition. For example I only want to select columns which contain the string “id” or only the numeric columns. Is …

How to select the 16 highest values out of 18 values SQL?

Ok so I have changed it from columns to rows instead 😉 Im saving grades for students. I have a MySQL table called “grade” with three columns called “subject”, “points” and “userId” with 18 rows with different subjects where each subject can have one of the value…

Add additional column to the query output

I have the following query that is grabbing data from a table and combining all the products into one column and counting the quantity of that order. I need to add an additional column to the output though, how can I also add ship_date? This is how the original table is laid out: And this is how the query out…

Get all tables data with Node.js and SQLite

Having these tables into a db: Athlete with fields: athlete_id, name, surname, date_of_birth, height, weight, bio, photo_id AthletePhoto with fields: photo_id, photo, mime_type AthleteResult with fields: athlete_id, gold, silver, bronze Game with fields: game_id, city, year The db model: The code so far can o…

Sql join in two tables and return empty tab as Unavaliable

In a SQL join, table 1 contains person info with city and table 2 contains city matched to country such as:- Table #1 Table #2 I want to get the person ID, Name, Country so while joining the tables I want these items and if there is no country available for a city, I want “Unavailable” written in …

Query to find people with multiple names

I’m working on a fairly big project that allows users of my client’s site to search for people they used to know who might’ve changed their names, primarily due to marriage. Basically, users sign up with all the names they’ve ever used and the data gets entered into a MySQL database. T…