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
1 answer

oracle sql query select

table tourist table stay table hotel i want to print the names of the tourists who have been to hilton but not to continental so the tourists who have been to hilton and continental both shouldnt be printed
mr robot
  • 21
  • 5
-1
votes
1 answer

Show the names of customers that have accounts SQL Query Oracle 10G

create table customer (cust_id integer not null, cust_name char(20) not null , cust_address varchar2(200) , emp_id integer not null, constraint pk_customer primary key(cust_id) ); create table…
-1
votes
3 answers

How to skip the first row of data in SQL Query?

I have this code: select DOLFUT from [DATABASE $] How do I get it to get data from the 2nd line? (skip only the first line of data and collect all the rest)
-1
votes
3 answers

How to use LIKE in SQL Query in where clause, but the value of LIKE will come from in other query?

How to use LIKE in SQL Query in where clause, but the value of LIKE will come from in other query? For example: SELECT Code FROM TABLE1 where Code LIKE '(select top 1 Grade FROM TABLE2 WHERE Age>30)%' Please anyone can help me
Schadrack Rurangwa
  • 413
  • 12
  • 28
-1
votes
3 answers

How to retrieve column names when saving a SQL query to a text file

I wrote a method which saves the content of a specific table to a text file. Unfortunately the names of the columns are not retrieved. "Only" the data of each cell is written to the text file. How do i need to adapt my code to also include the name…
fabian09
  • 111
  • 2
  • 11
-1
votes
2 answers

format a string the contains '%' golang

I have an SQL query that looks like this: SELECT name FROM sessions WHERE name ILIKE 'org_name.%'; but I'm actually interested in replacing 'org_name' with format string (%s). I was trying to do something like this: query := fmt.Sprintf("SELECT…
Nyta
  • 557
  • 1
  • 7
  • 18
-1
votes
1 answer

SQL Server: view CASE WHEN THEN ELSE END ROWNUMBER + the last value

Table I'm trying to add on each row the value of the last QTY of the SAME item. How can I do this? Here is the idea I have that I think might work: USE [Data_Test] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE VIEW…
-1
votes
3 answers

How to get count of average calls every 5 minutes using datetime sql

I am running the following query select DateTime from Calls where DateTime > '17 Oct 2018 00:00:00.000' and DialedNumberID = '1234' What would this give me is a list of all the times that this number was dialled on the specific…
ivan
  • 15
  • 6
-1
votes
1 answer

SQL: How to pass mutliple select queries to an sql Function

I have the two select queries below : SELECT column_1 FROM table_name WHERE **column_2= 'X'** AND scope= 'scope'; SELECT column_1 FROM table_name WHERE **column_2= 'Y'** AND scope='scope'; I want to pass each of the above queries to a predefined…
-1
votes
2 answers

NEWID() is generating bad format values in SQL Server

I'm generating unique identifier values using NEWID(). The problem is sometimes values are generating like "65687519-E612-4B86-A8D8-F44E53DD6EDC" The first part of unique identifier value is all numeric characters(65687519). This is creating some…
Gopal Biswas
  • 409
  • 1
  • 7
  • 34
-1
votes
1 answer

Syntaxe error source with QSqlQuery

I have a problem with a QSqlQuery when I execute a source command on my database. This code works : QString myRequest = "CREATE DATABASE MY_DATABASE;"; lQueryResult.Exec(myRequest); if(!lQueryResult.GetMexec()) { qDebug() << "Error in the…
Anonymous
  • 468
  • 5
  • 26
-1
votes
2 answers

QList crashes when size is large

I am using a QList to store the data read from a SQL Table. The table has more than a million records. I need to get them in a list and then do some processing on the list. QList list; QString selectNewDB = QString("SELECT * FROM…
medasumanth
  • 381
  • 4
  • 10
-1
votes
3 answers

Add a column in SQL query that indicates the number of times that the number is shown in other tables

I need to make a query that selects everything from a table A, and in addition to have a column that indicates the number of times that the value of A.col1 is in B.col2. Example: Table A: id name 1 "y" 2 "z" 3 "w" Table B: id …
Yuvalb
  • 193
  • 1
  • 1
  • 6
-1
votes
7 answers

Sql where clause not working

SQL where clause is not working in my database. I have a table called "sites" and structure like that id site 1 xyz.com 2 google.com 3 example.com I am running this SQL query SELECT * FROM `sites` WHERE `site` =…
Rinku
  • 83
  • 1
  • 1
  • 13
-1
votes
2 answers

substring, replacing format

hello i have row of data 1000 records, that i need to replace and substring in the format like below: i have this format 004320487091 and i need to convert it to 0.432.487.091 any thought any helps please?
osama
  • 5
  • 4
1 2 3
27
28