Tagged Questions
2
votes
1answer
16 views
stat report combining data from 3 tables - join or subquery
I have three tables: tbl_Player, tbl_MatchDetails, tbl_MatchStat with some data:
tbl_Player
CREATE TABLE [dbo].[tbl_Player](
[PlayerID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) ...
-1
votes
1answer
31 views
optimizing sql query with multiple select from
Hi everyone I am hoping for some help/insight/ideas on how to best select data from my tables(I can do inner joins but that's about as "complicated" as my knowledge goes with SQL). Well I'm using this ...
1
vote
2answers
20 views
Search sql database using select dropdown?
I have managed get the search function to work but it is very chunky :(
Code:
If dropdown_sV.Value = "N" Then
If WhereParts > 0 Then
WhereClause = WhereClause & " AND"
...
0
votes
1answer
46 views
Select columnValue if the column exists otherwise null
I'm wondering if I can select the value of a column if the column exists and just select null otherwise. In other words I'd like to "lift" the select statement to handle the case when the column ...
0
votes
2answers
34 views
Grouping values from dynamic columns
I have two tables with data
TAB1
-------------------------
| ID1 | ID2 | A | B |
| 1 | 8 |'John' | 9 |
| 2 | 9 |'Smith'| 0 |
TAB2
...
0
votes
2answers
44 views
Pivot on joined tables SQL Server
I have two tables with data
TAB1
---------------------------------------------
| ID1 | ID2 | SIGNEDBY | A | B | C |
| 1 | 8 | 'aa' |'John' | 9 | 12/12 |
| 2 | 9 ...
0
votes
1answer
56 views
MS SQL - One to Many Relationship - Need to return single row
I have the following tables -
Search Result
----------------
SearchResultID PK
ProductID FK
SearchQuery
WebsiteName
URL
IsFound
CreatedOn
BatchID
Name
SearchResultItem
-----------------
...
2
votes
1answer
47 views
SQL Server : Select max with Sub-select
I am try to get a max value of a result set of another select in SQL Server, but not able to. I am not sure what I am doing incorrect in SQL Server. Any help would be great.
This is my SQL:
select
...
0
votes
1answer
16 views
Get Updating Value of Column in Trigger
DECLARE @IsDeleted AS BIT = 0;
SELECT @IsDeleted = IsDeleted from Updated
IF @IsDeleted=1
BEGIN
UPDATE Reviews
SET IsDeleted = @IsDeleted
WHERE CompanyID = 1
END;
I want ...
-1
votes
2answers
50 views
calculating a percentage based on results from the query
I currently run the query:
select table1.columnA as Barrier_1,
table2.columnB as Action_1,
from table2
join table1 on table2.PrimKey = table1.PrimKey
where table1.columnA is not null
...
0
votes
1answer
49 views
Select statement not working in sql server
In microsoft sql server 2005, classic asp code, I call a sql query using this:
selectHireResponseSQL = "
SELECT HireResponseID, HireResponse, DateResponse, Comments, YearFileOpened
, ...
-1
votes
2answers
33 views
Select distinct with join and group by
I'm trying to run the query:
Select Distinct table2.columnA columnA_0 ,
table3.columnB columnB_1 ,
table2.columnC columnC_2
From table4 Join table1 on table4.columnD = ...
1
vote
1answer
32 views
Count the Occurrences of an Attribute?
I have an XML column in a large table that looks like this, in TSQL how would i count the number of times an attribute (LCPID) occurs?
Thanks,
The code:
<soap:Envelope ...
2
votes
1answer
60 views
Oracle and SQL Server reserved keywords
I need a list of Oracle Database 10g and SQL Server 2008 reserved key words. My application performs DDL statements, thus I need to validate the entered table-, column names, etc. against the reserved ...
0
votes
2answers
73 views
C# multiple SQL server selection [closed]
I want to connect to a SQL server and select data from multiple tables using the SQL statements in the image below. SQL connection information is stored in the table. Finally, I want to show all the ...