Skip to content

Executing a SQL query with C#

I would like to add some information to my database. I searched for some tutorials, but none of them work. NonQuery can do what he needs to do, because the messagebox returns “Success” (1). But it does not update my database. If I put the same query to “Add New Query”, directly to my d…

Find name of manager with max number of subordinates

I need to write SQL query (for Oracle) which displays name of manager with max number of subordinates. Table’s structure: MGR_ID employees’ attribute is an EMPNO(primary key) of manager. What I’ve tried so far: Answer Another version suggested by a_horse_with_no_name PS : Query Not Tested

Symfony doctrine orderby and group by (distinct)

I am trying to get the latest booked courses (unique). I have tried the following with the Doctrine querybuilder: Without the orderby it works but it will traverse the bookings ascending. I need the latest booked courses. With this query I am getting this error: SQLSTATE[42000]: Syntax error or access violati…

Limit SQL Primary Key to certain ranges

I want to make the autoincrementing Primary Key of my table to only be in the ranges 1-12, 101-112, 201-212, etc. This is because I have a series of repeating items that are 12 in a set and then you get another set, having them indexed in this way by the Primary Kay would be most easy, I think. Is

Register temp table in dataframe not working

Below is my script to use sql in dataframe with python: df.show(5) shows result below: then I register the dataframe to a temp table: and tried to run some sql query like below: It doesn’t produce expected result, instead: I also tried: and it gives me: So it seems the registerTempTable method only crea…

Count on case Oracle

WE have below data in oracle database – I want count on column two in such a way that – Ouput – Best Regards Answer Thanks Guys. But I could do this way – Thanks for your replies