Questions tagged [select-query]

176 questions
0
votes
0 answers

How to get the count of records returned by teradata sql griup by query

I have a condition where I need to check number of rows returned by select query in Teradata. My query looks like below select PDate ,Risk ,BName ,BNumber , ONumber ,OnNumber ,ID_CD ,Entity , AU ,RType, count (*) from Load_one.import_test group…
Sam
  • 39
  • 5
0
votes
3 answers

Postgres query from two different table

Hi i have queries that I use to get single result. How could I do this with just one query? First I ask SELECT "userId" FROM "Devices" WHERE "deviceNumber" = '0001563055080020' Then save UserId and ask following another table SELECT "email" FROM…
Ville
  • 105
  • 2
  • 2
  • 8
0
votes
2 answers

Select query, difference in dates with multiple record on MS Access

I am working on a database, but having trouble with something(total noob). I can't post the images yet on this account, I have posted links to my images. Basically, I have a reservation table and a room table. I wanted to make a Date Diff operation…
0
votes
0 answers

Group a table with a junction table

I have a table EVENT and a table ATTENDEE. When grouped by its lookup values EVENT looks like this: |EVENT_ID|EVENT_TYPE|CITY|STATE|ZIP| Many events can have many attendees, so I then have an EVENT_ATTENDEE junction table: |EVENT_ID|ATTENDEE_ID| I…
Sean
  • 1
  • 3
0
votes
1 answer

select query without giving space in-between *(star) symbol

select*from tablename -- without spaces in-between the star symbol select * from tablename -- Applied spaces in-between the star symbol Both queries are working in my Sql-Server-2016 query window. What is the difference and which situation we need…
Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234
0
votes
0 answers

How to send emails by any format using different SQL Select statements?

I have few SQL Scripts (4 select statements & each 2 from 2 different databases). I need to add them and set all in single e-mail sending in .csv or HTML format. Is there any option in SSMS or do I have any options? I tried with UNION ALL and did…
CR241
  • 2,293
  • 1
  • 12
  • 30
0
votes
0 answers

SQLServer- How to pass select Query with ',' in it

I have a select query which I want to pass as @sql parameter- but I am getting error with syntax in ',' so how to avoid that and pass [','] in sql statement. I am using SQLServer select SERVER_ID, replace(stuff((SELECT STATUS+ ', ' +…
0
votes
2 answers

Sending data from sql database to mysql database

I need to get the data from the sql database and send it to a mysql database programmaticly how could I do this? Here is what i'm currently trying Try con3.ConnectionString = MyConnectionString con3.Open() Dim cmd As New…
Jelly Bean
  • 1,161
  • 1
  • 11
  • 22
0
votes
1 answer

SQL Server how to sum data of each row

So I have two queries that look like this: Query1 CPT Resource 1 2 3 4 5 2017-06-11 RM1 0.000 28.000 28.000 28.000 28.000 2017-06-11 RM2 14.000 23.000 28.000 28.000 0.000 2017-06-11 RM3 0.000…
Ray
  • 41
  • 7
0
votes
1 answer

Access 2010 Select Query - Prior business day

I have a select query in MS Access 2010 and need it to pull from the prior business day. The problem I'm having is I need Friday's data when the query runs on Monday mornings, every other day of the week I only need the prior business day. Below is…
lorac1969
  • 1
  • 1
  • 7
0
votes
2 answers

Possible to reference previous query in new select query?

If i just created a select query and want to use the new data in a new query do I reference the previously created query as the FROM in a new select query? The query I just created in my database is listed as SQLQuery1.sql so is that what I put as…
Ray
  • 41
  • 7
0
votes
1 answer

Accessing created column in another column

I just want to know if there's a way to access the new column that i created which is the 'Age' so that my condition in the next column will work ? here's my code , Advance Thank you for the response ^^ enter image description here
Jihyo
  • 1
0
votes
1 answer

Complex SELECT Query Format for C# Form

I have a table with the following columns: SupplierId SupplierBillID SupplierDate Supplierparticulars SupplierCredit SupplierDebit Now, the problem is that earlier I had only 1 particulars in 1 bill. Now I have more particulars in the bill and…
0
votes
1 answer

How to query in cqlengine to get aggregated values from cassandra tables

In Cassandra to get the aggregated data like sum,avg,min,max we use a query like,: SELECT avg(race_points) FROM cycling.cyclist_points WHERE id=e3b19ec4-774a-4d1c-9e5a-decec1e30aac; But, in cqlengine how is this be done.? I have columns with name…
0
votes
1 answer

How Select specific merge columns from excel sheet using ole db c#

I want to get the red highlight RowColumn. First column is made of single cell A4 and next is made of merge cells [BCDE4],[FGHI4],[JKLM4],[NOPQ4],[RSTU4],[VWXY4] ("select * from ["+sheetname+"$A4:V4]", MyConnection); Table goes here:
Haseeb Butt
  • 109
  • 5