REQUIRED QUERY : select all memberid from query 1 having higher count than query 2 the aim is to display all memberid who were leader/organiser/helper more times than they participate in event how …
Tag: sql
Grouping other fields by common email
I’d appreciate any assistance people could provide with this one. I’ve tried to follow a couple of other posts (GROUP BY to combine/concat a column), but when I do this, it combines everything. I …
how to delete rows where a single column value is duplicated
I need to remove all rows having duplicated title column. Something like: delete from clients where title is duplicated For example, if five rows have the same title column – four of them shold be …
I got mysqli error 1064 but i don’t know why
I want to post this data from android client and i tested it with postman and status code was 200. But i have a mysqli error and it’s: Error: ((1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘WHERE id=&#…
Can’t insert into database with save()
I am having an issue inserting a record into the database. I am a beginner with the Yii framework, so I may have made some stupid mistakes. This is from the SiteController public function …
SQL Window Function – Number of Rows since last Max
I am trying to create a SQL query that will pull the number of rows since the last maximum value within a windows function over the last 5 rows. In the example below it would return 2 for row 8. The …
Creating dynamic query using jpa criteria
I created dynamic query using jpa criteria but an extra pair of parentheses gets added to columns to be selected when I do userGroupSubquery.select(userGroupsRoot); generated query select (…
Relational Databases: Is it fine to have a foreign key referencing an Associative table?
Lets say we have Passengers, where Passengers can attend many Flights, and one Flight may have many Passengers. In each Flight, each Passenger has a unique selection of Movies he/she can watch. For Passengers, Flights, and the association between them, we have three tables: For Movies, it must specify for whi…
Why does outer reference in SQL subquery produce different results?
I run two SQL queries: The first one have an outer reference to the table inside subquery. In the second one I add the same table inside subquery. The results are different, it fails due to multiple …
Deploying multiple SQL jobs in the same .sql file
So this is something I already do with Stored Procedures, and a bunch of other database items, and now I’m trying to do it with jobs. I write a bunch of items to a single .sql file. Other programs I …