Mysql performance and Count(*)
I want to know that my sql execute count queries in linear time or in log(n) time i think that if query parameter was indexed it can do it by cubing ...
I want to know that my sql execute count queries in linear time or in log(n) time i think that if query parameter was indexed it can do it by cubing ...
I have a database for which I need to aggregate records into another smaller set. This result set should contain the difference between maximum and minumum of specific columns of the original records where they add up to certain SUM, a closed interval constant C. The constant C determines how the original records are aggregated and no ...
I'm in the process of generalizing a Django DB replication app and it uses the statement: SELECT %s FROM %s LIMIT 1 to fetch 1 row and use the Python DBAPI to describe the fields, it works fine with ORACLE and MySQL but, how cross platform is the LIMIT statement? ...
I have scenario like, I need to add my join in conditional e.g. When value is 1 then inner join to table a and if value 2 then inner join to table below is my sample query and I am getting error Incorrect syntax near the keyword 'inner' DECLARE @i INT=1 select name from emp if(@i=1) begin inner join a on a.ID=emp.ID end else if(@i=1)...
Hello here is what I want, I connect to a DB and retrieve the biggest element of the UniqueId column, and assign it to an integer variable named maxID, here is my approach: int maxID = 0; Statement s2 = con.createStatement(); s2.execute("SELECT MAX(UniqueId) FROM MyTable"); ResultSet rs2 = s2.getResultSet(); // while ( rs2.next() )...
Hi, We have a data table in our ASP.NET application. It is holding 800+ records. Now we need to store all these records into database at a shot by using a SQL Server Stored Procedure. Would you please let me know the best way to implement it and a reference code sample. Thank you, Regards. Venkat. ...
I am trying to do an SQL query on two tables to retrieve multiple columns with a certain column (PostID) to be distinct (and it is not the primary key of the that table). In addition, I need the selected distinct rows to be the latest (one of the columns retrieved is the entry date). Detailed description: I am building a forum like ap...
Hello, What are the pros and the cons when we have the choise beetween using a direct database accès or using a web services ? What would be your choice for a critical application, that should be responsive (<0.5 sec) and with a low call to this webservice/DB (NB : the web service will be maintained by an other team). ...
Hi there. My question would be what's wrong with the next code? I'm trying with j2ee to read some unicode from a database and some characters are returned as the famous question mark. try { Class.forName("com.mysql.jdbc.Driver"); String connectionUrl = "jdbc:mysql://localhost/hortimart?" + ...
I have three tables with a one to many relationship as shown below. What I would like to do is select all the data from "tblOne" based on their relationship to "tblThree". So without having a query to get all tblTwoIDs I would like to select from tblOne where tblThreeID equals an "Inputed Value" Hope this makes sense, Thanks Ben tblO...
Hi All, Is there a possibility that a simple delete query can bring down a DB? We executed a delete query (single row deletion) and that query hung. When multiple people tried executing the same delete again, the Oracle DB is down. Multiple tables reference this table and a cascade delete was not used. Should a cascade delete have bee...
I am looking for advice. I know stackoverflow likes "answerable" questions, I hope this is. I have a large legacy (Windows) application, using a proprietary (ISAM) database. I wish to investigate moving it over to using a SQL database: primarily MS SQL Server, I wouldn't mind Oracle flexibility but that is only a "would be nice", and ...
I have an application which utilizes graph (tree-like) custom structures. The structures are not real trees, but pretty much everything is connected together. The quantity of the data is also big (millions of nodes can exist). Tree-nodes can vary in type to make it more interesting (inheritance). I don't want to alter the data-structures...
Background: Our C# application generates and executes queries to several types of databases (Oracle, SQL Server, MySQL), but a requirement came up to also apply them to a proprietary file format. The namespace used until now is System.Data.Common. The queries we need to apply are non-trivial (nested SELECTs, aliases in FROM, substring...
I am currently using Toad for DB2 to work on my DB2 database. I just wanted to know is there any free alternative to Toad for DB2, Note: Similar question is posted earlier, but it was for TOAD [ oracle ], none of the solution specified is for DB2 obviously. ...
I'm tasked with doing a SQL Server 2000 to 2005 migration. I will be doing a side-by-side migration. After restoring from a backup I plan to do the following: ALTER DATABASE <database_name> SET COMPATIBILITY_LEVEL = 90; DBCC CHECKDB(<database_name>) WITH NO_INFOMSGS DBCC UPDATEUSAGE(<database_name>) WITH NO_INFOMSGS exec sp_updatest...
Hello , I am trying to connect to the existing db in oracle with fluentmapping . I got Mapping over CUstomer public CustomerMapping() { Not.LazyLoad(); Id(x => x.Cst_Recid).GeneratedBy.Increment() ; } and i am trying to create session public static ISessionFactory CreateSessionFactory() { retur...
I have a form containing two text boxes for user input. Both text boxes have the Property format set to "Short Date". One is the "start date", and the other is the "end date". I also have several tables, each with a DateTime field ("studystartdatetime"). I would like to be able to query these tables, but restrict the results to rows ...
I'm currently again working on a program from when I was, umm... less capable. It has a number of problems: The database collation is latin1_swedish_ci. I would like to convert it to utf8. How would I do this? The database has some fields that are boolean values stored as 0 or 1. However, the fields are varchars instead of bools. How c...
I have an idea for a site that involves uploading files to the site. But what I'd like - and wondering if it's possible - is when a user clicks on "Browse", and selects the file, if it's possible for the site to automatically scan the site's database for similar files before they upload the file to the site. Kind of similar to the automa...