I’m working with a DB2 database, and was wondering whether a function exists that allows me to determine whether a set of columns meet some criteria. I can simply use OR to accomplish this, however, …
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 …
Flagging column based on condition using SQL
I have a table like this , Address X1 X2 ABC RF_Error PRE ABC RF_Error PRE DEF WIFI PRE DEF WIFI PRE DEF WIFI POST HGI RF_Error PRE …
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 …
Are changes made to DB only through transactions?
I am not able to get a clear complete understanding regarding the role of transactions in databases. I know operations clubbed in a transactions will be executed together and then either committed or …
Query to obtain the maximum primary key ID of a table for each unique value of the customerID column in the same table
I’m trying to run a query that takes obtains the maximum QuestionnaireId value for each unique value in column VendorId. So for example from this table: QuestionnaireId VendorId 1 …
How to compare column values in SQL grouped by one column?
I am practicing SQL from a cars database and I have the following CAR table/view and I need to select the brand which sells more cars than engines/motorcycles. This means that I have to select the …
Use select statement as the limit to the outer select statement
Looking to get the top half of a table, I set a select statement that returns an integer as the limit to the outer select statement and got a syntax error. I checked and ran the select statements …
Open form from listbox selection
I’m trying to open a form with a SQL condition set up from items selected in a listbox. I keep getting an error Syntax error in query expression. Which I don’t understand because if I create a new …
Connection to a Local Database
I’m working on a Text-based RPG game using C++ in Visual Studio, where I want player account details and infomation to sit on a database, and I have previously been using Microsoft Azure to host a …