Questions tagged [qsqlquery]

The QSqlQuery class, part of the Qt framework, provides a means of executing and manipulating SQL statements.

QSqlQuery encapsulates the functionality involved in creating, navigating and retrieving data from SQL queries which are executed on a QSqlDatabase.

Documentation can be found here.

417 questions
0
votes
3 answers

How to improve perfomance of SQL Server query

I have the following query in Stored Procedure: UPDATE dbo.CRM_tblActivityStore SET StoDateChngFlg = CASE WHEN x.STAGE_STAD <> x.ACTSTR_STAD THEN 1 ELSE 0 END FROM (SELECT CASE WHEN sd.stad = '00000000' THEN '12-31-2049' ELSE…
0
votes
2 answers

SQL AND OR query

I am trying to select some messages from our customer service queries, WHERE Mmessage owner is ABC, data are LIKE ABCDEF AND message ... AND where the message is either from Customer to CSservice or from CSservice to Customer. How can I do…
Petrik
  • 823
  • 2
  • 12
  • 25
0
votes
3 answers

SQL Row Comparison Query

I am new to SQL and trying to write a query against the following results table that would allow me to list the subjects where the student Mary has got a higher score than Tom. Subject Student Teacher Score …
fishboy76
  • 11
  • 1
0
votes
4 answers

Duplicate Records in SQl Server Table Different year

I am attempted to write a query that find duplicates. The query would look at the Latest 2013 order dates then Match with Latest 2014 orders, in order to find records that exists in BOTH years. My code only gives me 2013 data and not for both 2013…
0
votes
1 answer

Update one Table with data from another Table

Hello I have a table named scores and another named games. As basic as possible the tables look like this. scores: Player      AverageKills extcy         5 games: Player      Kills extcy         5 extcy         6 extcy2       4 extcy         7 I am…
moveit124
  • 61
  • 8
0
votes
0 answers

QSqlQuery bindValue adding quotes to string

I created a function to add new records to an sqlite table everything works fine but when trying to insert strings two extra quotes are added code: int dBase::ajouter(QString table,QVector valeurs) { connect(); QSqlQuery…
0
votes
1 answer

SQL Server 2014 Standard Edition Large Table performance

I have a question with regards to performance currently I have a table that is having trouble with query performance whenever the table rows in already millions of record. This is the table: CREATE TABLE [dbo].[HistorySampleValues] ( …
carlcrol
  • 77
  • 1
  • 9
0
votes
1 answer

Selecting a row with unique ID

I need to select the last row from two datasets. I need the main_ID and the key_ID. However, the main_ID will often have multiple key_ID.. in addition to these two rows I need address insertion date and name. The data comes from table one with…
Ryan
  • 1
0
votes
1 answer

SQL: Finding averages and grouping by two parameters

ID Year Month Price 001 1990 JAN 6 001 1990 FEB 8 ... 001 1990 DEC 4 001 1991 JAN 7 ... 001 2000 DEC 6 002 1990 JAN 7 ... Given a table formatted like the one above, how…
Jose
  • 1
  • 1
0
votes
1 answer

How to fetch row at given index from QSqlQuery

I am learning QT and using QSqlQuery to fetch data from database. I have read this documentation. I know using next() function we can iterate through rows of QSqlQuery and using value(int col) function we can get data from current row. But i dont…
Harikesh
  • 313
  • 3
  • 14
0
votes
1 answer

MySql Table schema performance issue

I have the following table in mysql database: CREATE TABLE `chronologicallists` ( `sno` int(250) NOT NULL AUTO_INCREMENT, `empSno` int(11) NOT NULL, `dateOfHearing` date DEFAULT NULL, `stageOfProceedings` text CHARACTER SET latin1, `isDecided`…
Abdul Rahman
  • 1,669
  • 4
  • 24
  • 39
0
votes
1 answer

database schema for customers

Right now I have two tables orders and customers,each order has his customer.Orders table hold details about a order and his customer id. Customer table hold information about a customer.The thing is that those customers have properties of a natural…
Serban Alexandru
  • 165
  • 2
  • 13
0
votes
1 answer

Customers database structure

I have two tables Orders and Owners which represent natural person owner of a order.In order tables I have a OwnerId column that make the conection.Now I want to add a legal entity type of Owner the problem is I need to add it as a new table and…
0
votes
1 answer

how does count work in sql query

I'm doing a exercise about SQL query and I came up with an error when it comes to SUM. I know what is does, but I somehow get an error... select client.LName, client.FName, COUNT(b.Total) from ClientBank client INNER JOIN Bank…
user3342795
  • 105
  • 3
  • 6
0
votes
1 answer

an "Update" function on the result of a query

I am going to perform an UPDATE on the result of a query in SQL Server 2008 but it seems UPDATE needs a name for table it is not possible. I am going to do this UPDATE (SELECT ~) set x = "1" where x IS NULL BUT really I have problem in "VIEW" to…