Tagged Questions
-2
votes
3answers
48 views
how to write loop statement in sql to get values in one parameter
i am so new to t-sql in sql server. how to loop through select result. example here:
Table:
ItemName Value
XPS_Paid XPSP001
XPS_UnPaid XPSUP001
ALTER PROCEDURE [dbo].[sp_vendor_config]
...
1
vote
1answer
125 views
For Loop Basics in SQL
I discovered the power of for loops when dealing with repetitive tasks when I first learned R. Now, I want to apply the same logic to SQL, but I am struggling to understand the fundamentals of psql. ...
0
votes
1answer
39 views
Oracle SQL - Filling student graduation requirements with credits earned. (Loop or Creative Join?)
I'm a bit stumped on how to structure this query. I have two tables, one with graduation requirements (GradReq) and one with earned student credits (StoredGrades). GradReq lists each "credit bucket" ...
1
vote
0answers
18 views
Iterating through a list of variable to build tmp
I have a large set of numbers used as a variable in comparing two queries. The queries are rather time consuming to run so I would like to be able to do this automatically to sort out all variables ...
1
vote
0answers
24 views
Data comparision using loops and respons relatedness
Data information
Table one contains specific responses for a set of 10 questions
Table two contains users’ submissions which may contain blank responses, and incorrect ones as well.
Task identify ...
0
votes
0answers
60 views
PHP looping through sql results to generate 3 twitter feeds
I am creating a website where a user inputs three terms of their choice to then be searched on their twitter feed page. They can input up to three terms and on their feed page 3 feeds will appear.
...
0
votes
0answers
57 views
PHP PDO binding variables to a string while concatenating it
I'm trying to create an SQL statement which looks something like this:
SELECT * FROM `table` WHERE `attribute` LIKE %variable_1% AND `attribute` LIKE %variable_2% AND ... AND `attribute` LIKE ...
0
votes
0answers
36 views
Use SQL in loop to create new features based on unique values
Hello StackOverFlow Community:
I have a shapefile which contains point values for fire events in state parks (there are about 20 parks in total). I want to create separate shape files for each park, ...
0
votes
0answers
53 views
SQL BulkCopy to mutiple tables c#
I am trying to copy data from one database to another using SQLBulk Copy and can not get it right. I noticed on the inner loop the database does not change back to the dbProduction, resulting in a ...
0
votes
0answers
149 views
Collect Multiple SQL Search Results and Save to Tables in Excel with VBA
I am using the below VBA code snippet from this site (mod from MSDN) that shows me how to grab results from a SQL query into an excel sheet (Excel 2007):
It works great for pulling from one SQL ...
0
votes
0answers
78 views
SQL Switch Case Query Statement Function Cycle Dates?
I am trying to work out some logic here. No clue how to apply it in SQL.
I have a view With ID, Name, Worked_Date, Work_Type, Work_Category, Work_Location, Total_Worked_Dates_in_Table and Fees
I ...
0
votes
0answers
117 views
String Concatenation and Looping to create “IN” list
I'm bald from pulling my hair out... can't figure this one out despite literally tens upon tens of hours. I'm trying to build an "IN" statement string while looping through and reading values from a ...
0
votes
0answers
48 views
Synch between Access(mbd) and Mysql
I am trying to set a mechanism between mysql (phpmyadmin) and my MS-Access database, the work out in my mind is
connection with MYSQL
Connection with ACCESS (odbc)
$mysqlquery="SELECT field1, ...
0
votes
0answers
73 views
Add variables to existing array SQL loop
I've got a loop which fetches me some results from my table. Now I want for every result (row) to add the contents of certain fields to an array. My array is called $productsoorten and I created this ...
-4
votes
0answers
67 views
For each loop in SQL Server
I want to change my code to create a view with columns from 1 to 65 (XXX) with no need to repeat line 65 times, but achieve this through a loop.
Select
For each XXX = 1 to 65
SUM(CASE WHEN RepaidDay ...