I have this (3 int columns in one table) I would like to run such query with another someTable: where 1,2,3 are list of INTs converted to a list that I can use with SELECT * NOT IN statement Any suggestions how to achieve this without stored procedures in Micorosft SQL Server 2019 ? Answer If you want rows in
Tag: sql
SQL – ordering table by information from multiple tables
Title of the question may not have been very clear – I am not really sure how to name this question, but I hope that my explanation will make my problem clearer. I have 3 tables: [1] score id rating_type 1 UPVOTE 2 UPVOTE 3 DOWNVOTE 4 UPVOTE 5 DOWNVOTE 6 DOWNVOTE [2] post_score post_id score_id 1 1 1 2
How to map data between tables when they are connected by foreign key in mysql?
I have a table for resources which contains resources like case studies, whitepapers, webinars etc. It has one to many relationship with another table case_study_blocks. So there is a foreign key caseStudyId in the case_study_blocks table, which points to case studies in the resources table. I want to move al…
Identify the pattern to get desired output
We have below table contains multiple code against the ID and CounterID. Need an output based on code and id. Condition: Against the ID and CounterID case 1 : if there is code CI and CO then no record case 2 : if there is code CI and CO and CI then last record with code CI case 3 :
Creating specific size
I have a table in html.I want to add that table with php on my database. The problem is with my table. I have done that I have 24 positions and that I want to give in my table that those 24 are that size,not 25 and going on..Second,I have B and R that it is the color (It is
I am trying to provide a ranking based on a previous partition
I am trying to change the ranking column where instead of ordering by RMSE ASC I want to order by RMSESum ASC (which was a previous partition by)….when I do this I get an error that “ordered analytic functions cannot be nested” any idea around this? Answer You should use the sub-query as follows:…
fixed number format with different lengths in Oracle
I need help with a Oracle Query I have a query: scenario 1: select to_char(‘1737388250’,what format???) from dual; scenario 2: select to_char(‘173738825034’,what format??) from dual; scenario 3: select to_char(‘17373882’,what format??) from dual; I need a query to satify al…
A better way to obtain SQL data than I am currently using
I need to retrieve data from an external SQL Server database and view it (not store it) in my ASP.NET MVC application. The only way I can connect to the server is by using a server name, port number and access to a SQL Server stored procedure that the server owners provide. Currently the only way I know how t…
Displaying multiple database tables in one table
I have multiple databases with the same table (an Eventlog with different values). The names of these databases are subject to change. I am trying to display the Eventlog tables in one consolidated table with the corresponding database name. I tried to using cursor and dynamic SQL statement to achieve this wi…
How to optimize min and max to find highest score sum
This problem involves finding two min-max criteria filters to generate the highest score sum in a dataset. I have a dataset, with 3 columns. x, y, score, with over 1 million of rows. x y score 3.6 1.2 -5 4.2 1.2 -4 1.2 30.2 1 2.9 6.8 6 3.1 5.8 7 0.1 15.8 7 The data may or may not