Category "subquery"

Error: 'duplicate key value violates unique constraint' even when checking with 'where not in'

I get the error: 'duplicate key value violates unique constraint' even when checking if the primary key is already in the table in which I want to insert. I ha

SQL group by in Subquery

I'm trying to get monthly production using group by after converting the unix column into regular timestamp. Can you please tell how to use group by here in the

Subquery in yii2

I have 2 tables projects (id,name) accounts (id,project_id,account_name) I want to find all projects with their account_name like this SELECT Project.*,(S

WordPress Subquery returns more than 1 row on SELECT

I am executing this query with core cron by custom Wordpress plugin: // MAKE SQL CALL $SQL = "SELECT ".$wpdb->prefix."postmeta.post_id FROM ".$wpdb->

Subquery in yii2

I have 2 tables projects (id,name) accounts (id,project_id,account_name) I want to find all projects with their account_name like this SELECT Project.*,(S

Using SELECT TOP 1 in subquery in outer SELECT list (SAP ASE 16)

I have a query that works in Sybase SQL Anywhere 11 that I need to compile in SAP Adaptive Server Enterprise 16. The code doesn't want to compile in ASE though,

MySQL subquery overview

Alright I am guessing I need a subquery to solve this and I am little rusty on these. So I have 3 tables: tblAccount - Has User information and AccountID tblIte

ORA 01797- operator must be followed by any or all

I am testing a condition like this in the where clause of a subquery. But I am getting the error "operator must be followed by any or all" when I execute the SS