greatest-n-per-group
Getting around MySql Error 1093 with a NOT IN Subquery
How can I accomplish what I\'m trying to accomplish with the following query? DELETE SomeDB.outertable[详细]
2023-02-13 09:56 分类:问答Help with join query and return limit
I have two tables in my database - gl_weather_locations and gl_weather_data. I need to select location name, latitude and longitude from the locations table, then get only the most recent set o[详细]
2023-02-13 01:51 分类:问答SQL Server sample of each type of record
I have a table full of records for various semesters, and I want a query to select the top 5 rows from each semester.[详细]
2023-02-12 11:49 分类:问答Select one row per index value with max column value
With a table setup with the following fields: SKU, EVENTSTARTDATE, EVENTENDDATE, PRICE, (...etc...) and housing thousands of rows here is example data (dates are YYMMDD, century code excluded):[详细]
2023-02-09 13:46 分类:问答Can't figure out correct SQL query for historical table records
I\'m trying for hours to find out the correct SQL query to select the latest historcal record from a table (in MySQL).[详细]
2023-02-09 03:03 分类:问答Trying to find the second largest value in a column (postgres sql)
I am trying to find the second largest value in a column and only the second largest value. select a.name, max(a.word) as word[详细]
2023-02-08 14:58 分类:问答MySQL Query: Getting the most recent forum post
I\'m doing some work for a department that has a pretty basic table structure set up for their forums in a MySQL database:[详细]
2023-02-08 03:00 分类:问答How to get the last 3 distinct ids from a mysql table
Ok so basically I have my database table.The first column is the id.Th开发者_运维技巧e second is a pkg_id.The 3rd is not important and the 4th is the previous id that the pkg_id was located at.I nee[详细]
2023-02-07 12:50 分类:问答Is there any way to achieve the following code?
I have an sql statement like.. Select Res1, Res2, Res3, Res4 from tbl1 where Res1=1 Group by Res2 Having Res4>0[详细]
2023-02-06 08:46 分类:问答Problem selecting max year, max month & max date in one query
CREATE TABLE TEMP ( C_INVOICE_ID NUMBER(10), DIA NUMBER, MES NUMBER, ANO NUMBER, SOCIO_NEGOCIO NVARCHAR2(60) NOT NULL,[详细]
2023-02-06 07:56 分类:问答