I have two tables Person and Skill. I have a join table: I have two rows in the Person table And Four rows in the Skill table And the Join table has I want to get a list of all people that have English, Math and Science as a skill (inclusive). A standard select will retrieve both Bob and John.
Assigning column value based on condition on another column in sql (teradata)
I have a table which has the following columns: Date, AcctId, CustID, BackupID, Logins, Amount. For a given Date, an AcctID can more than one CustIDs, but I want to assign a singular CustID to an AcctID based on the value of Logins. i.e.: If Cust1 has more Logins than Cust2 for the given Date and AcctID then …
Delete statement not working on query in oracle
I have a table BK_178_ABC. I want to perform delete statement on this table only when some condition is satisfied: My total count on this table is: select count(*) from BK_178_ABC; ==>22024727 I …
How to extract Year together with Month from this query
I have a query to show total orders by month based on a date column. May I know how to append year to the Month column? Answer I would just aggregate directly by the year and month, as a single text field: If you really want the year and three letter abbreviation for the month, you may try:
Out of range value for column ‘ownerid’ at row 1 node.js sql query
I am using a mysql pool here and I did a query inside of a query. This is supposed to save the guildowner ID in the database when this command is run. Unfortunately it does not let me run this code for some reason. I listed the error down below. Error: Answer The largest integer value allowed in mySQL int
Optimize Hive Query. java.lang.OutOfMemoryError: Java heap space/GC overhead limit exceeded
How can I optimize a query of this form since I keep running into this OOM error? Or come up with a better execution plan? If I removed the substring clause, the query would work fine, suggesting that this takes a lot of memory. When the job fails, the beeline output shows the OOM Java heap space. Readings on…
counting totals after left join and requiring 0 for a NULL variable – SQL Server
I am using SQL Server Management Studio 2012 and I am running the following query: I would like the total number of appointments for these 3 individuals for now. Then, I will include everyone in Table 1. Table 1 gives me the ID (one row per individual), Table 2 gives me all appointments across different days …
Postgres SQL Select two fields by most recent date, one field must be unique
I need to find which student belongs to which homeroom, as of the latest data inputted. Starting with this dataset: I want to only retrieve Alice’s most recent homeroom and Bob’s most recent homeroom: The typical answer of how to find the most recent record only applies to when you’re lookin…
SQL how to get the max date when already using max
I want to get the maximum f.post date, and then the maximum a.process date. When I try to use MAX(a.processdate), it won’t work because of the group by and the other MAX already used. This is my result so far: I want it to just return this: Note: a.processdate is an INT (I did not create the database th…
Excel VBA – ADO Connection to MS Access DB – Filtering results
I have a MS Access Database where I store some information of products and I have these fields: ID, Customer Part No., Description, Price, Observations I also have an Excel file where I have a column called Customer Part No. and in this column I paste the Customer’s Part I want to filter. I need a way t…