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
-1
votes
3 answers

SQL. When I trying to do something like "INSERT INTO Table VALUES(x1,x2,x3) - can the x1 x2 x3 be sql queries, like SELECT <...>

I want to do something like this: QSqlQuery q; q.prepare("insert into Norm values(select from Disc id_disc WHERE name_disc=?, select from Spec code_spec WHERE name_spec=?,?"); q.addBindValue(MainModel->data(MainModel->index(MainModel->rowCount()-1,…
Maksim Nesterenko
  • 5,661
  • 11
  • 57
  • 91
-2
votes
2 answers

Write a SQL query to show all the orderNumber whose customer Name start with letter ‘N’

Given image, I want to find the order number of all the customers details whose name starts with 'N'.
Rahul soni
  • 23
  • 5
-2
votes
1 answer

Data is inserted in this table but the datagridview shows as null values

table.Rows.Add(tb_customer.Text, tb_Item_Name.Text, tb_BatchNo.Text, tb_packing.Text,tb_quantity.Text, tb_discount.Text, tb_Price.Text, tb_total_Price.Text, tb_date.Text); dgv_invoiceRecords.DataSource = table;
-2
votes
3 answers

I Am getting Wrong Result In SQL Query

This is my query in which i am searching for the data entered in 2005 but it shows me wrong data
Y.m. Patel
  • 19
  • 2
-2
votes
2 answers

SQL Query for select from all column with same column name

I have multiple column with same name from multiple table, table_1 has column X, table_2 has column x and more. How to select query for X column from all table without union. If use union, i must write every table name on query statement, i don't do…
-3
votes
1 answer

Converting Tableau statement to SQL query for calculations

Good mortning, I tried to conver the statement in Tableau in SQL server, but I received an error.Could you help me how to return 2 values in the CASE statement in SQL based on certain criteria and multiply them to get the final computed numeri…
Jen
  • 1
-3
votes
1 answer

sorting lists in SQL

I am currently working on an SQL project and am unsure on what code to use in in order to get a specific output. Here is what the output should be " Sort the output in alphabetical borrower name order and then by loan date with the most recent…
-3
votes
2 answers

Join two tables with exact matching records

i want to join 2 tables with a varchar column and my condition is to join rows by its exact matched values. suppose table 1 : id   colname1                    name 1    sample text value(developer)    ram1 2    sample text value-coding…
Jishnu Chandran
  • 105
  • 1
  • 12
-3
votes
2 answers

I want to concatenate the result of these these two select queries as four columns in one table

select SUM (cp.TotalAmount) as totalPaymentamount, lvl4.SubSubsidaryAccountName as account1 from TBLCPVMaster cp,TBLLevel4 lvl4 where cp.SubSubsidaryAccountId = lvl4.SubSubsidaryAccountCode group by …
-4
votes
2 answers

Max Count Query

This is my table and the table name is "ad_publisher_details". I want to find the maximum publisher company name means the company name who has most number of rows. Can anyone help? Table:-
ad_id …
SAAN07
  • 23
  • 1
  • 4
-4
votes
1 answer

Getting data in data.frame for user specified variables

I asked this question yesterday and it was answered but I don't think they really understood my question. I need to extract data from a database. But the user provides the list of variables. I need my code to loop through each requested variable,…
-5
votes
2 answers

I cant write the correct SQL query correcty

I have 2 table in the database and ı am trying to filter some users according to some criterias. criterias table +---------+----------------------+--------------------+----------------------+ | user_id | searching_friendship | searching_practice |…
1 2 3
27
28