Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #914
~8K People Reached
Favorite Forums
Favorite Tags
Member Avatar for pc131

Hi All! I have 3 tables: test1 id name1 1 value1 test2 id name2 1 value2 test3 id name3 3 value3_01 4 value3_02 I want to display all records of table test1 with values of table test2 (test1.id = test2.id) and values of test3 (if test.id match with test1.id) - …

Member Avatar for pssingh1001
0
366
Member Avatar for walkermat

Daft subject header, but its early and brain not awake yet! One for the SQL gurus (either that i've missed something here....lol) I want to select rows where there are duplicates of data in some columns, but not others. Where a duplication IS found, i want to return all rows …

Member Avatar for dwyaris
0
267
Member Avatar for konczuras

Hello Everybody! I have the following problem: I want to make an application, which need tables to show, edit, etc. You would be able to select the table, which you want to work on, by a dropdownlist (the whole project is in ASP.NET). I want to load the selected table's …

Member Avatar for vectorsoftware
0
186
Member Avatar for sangfroid

Hi I am trying to write a function in which I customize my select statement. But it is not working as i desire... It is as [CODE] declare @column_name nvarchar(10) set @column_name = 'original' select @column_name from data [/CODE] Here original is the name of one of the columns. I …

Member Avatar for harie.in
0
137
Member Avatar for everhett.raman

Hi, As i was experimenting stored procedure's TRY-CATCH with RAISERROR, came across this issue. Would like some opinion on this. Microsoft sites documented as follows: SQL Error 0 - 10: caught in the TRY-Block, i.e. will not reach CATCH-block. SQL Error 11 - 19: caught in CATCH-Block SQL Error 20 …

Member Avatar for fx1250s
0
202
Member Avatar for faintfascinatio

I have an xml file, structure like so: [CODE] <people> <person.1> <fname>brian</fname> <lname>smith</lname> </person.1> <person.11> <fname>joe</fname> <lname>carey</lname> </person.11> </people> [/CODE] I am using openxml to read this file and insert names (and other person information) into a table. [CODE] DECLARE @person xml, @idoc int EXEC sp_xml_preparedocument @idoc OUTPUT, @person INSERT …

Member Avatar for faintfascinatio
0
142
Member Avatar for Gdyson

Hi I'm trying to query the following tables to find out the Resource Companyname and Project Title for any Recruiters who have worked on more than/less than 6 projects within a specified period. These are the tables: dbo.tblResources ResourceID Company Name dbo.tblRecruiters RecruiterID ResourceID dbo.tblProjects ProjectID Datecreated dbo.tblProfiles ProfileID ProjectID …

Member Avatar for Gdyson
0
103
Member Avatar for thahir

Table name = Contacts. Table attributes = first_name,last_name,email_address,other_email,address,phone,notes. I want to retrieve without repetition(DISTINCT) first_name and address. But, when retrieving these 2 data, i want all the other data(notes,last_name,etc..) associated to this the DISTINCT data to show. Is there any SQL data for this kind of situation?

Member Avatar for huangzhi
0
200
Member Avatar for neo.mn

Hi Everyone, I got a problem while creating a views in sql server 2005. In my database there are several tables which are accounts_transaction bill_info member_bill member_info relationship is exist between “member_info and accounts_transaction, member_info and member_bill, bill_info and member_bill” but there is not any relationship between bill_info and accounts_transaction. …

Member Avatar for huangzhi
0
135
Member Avatar for dh111

Is this the right place to ask the following? I have 2 tables in two different MS Access DB's. Access allows the ability of inserting data from DBA.table1 into DBB.table1, using the format [dba].[table1].[dbb].[table1]. Here's my problem. Using a single SQL Statement I can't figure out the following. DBA.table1 has …

Member Avatar for huangzhi
0
107
Member Avatar for _taz_

I have a query that works, I wanted to add another sum from another table, but when I do, the all the SUM values are wrong this works [CODE]SELECT Clients.ClientID, Clients.WholeName, SUM(CASE WHEN Payments.Creditorid = 0 THEN Payments.Amount ELSE 0.00 END) AS 'Admin Fees', SUM(CASE WHEN (Payments.Creditorid = 3) THEN …

Member Avatar for _taz_
0
168
Member Avatar for Tank50
Re: SQL

Hi I need a help in SQL,There is table called sales.Its contains the day,sales quantity.If I write sql like below [CODE]select day,Sales_quantity from Sales.[/CODE] Then result should be Day SalesQuantity Monday 20 Monday 302 Monday 50 Tuseday 30 etc.. The problem is I want to get result like below Day …

Member Avatar for huangzhi
0
120
Member Avatar for elauri

I have following tables table1 nr_key1 nr_dad1 table2 nr_key2 value (repeated ~n times with same nr_key2 and different value) in table2 nr_key1 = nr_key2 After I have iterated through nr_key1 I want to use recursion to select nr_key1 = nr_dad1 and iterate again table2 with the new nr_key1. This should …

Member Avatar for huangzhi
0
120
Member Avatar for deostroll

Is there a way to isolate the nth record from a table using [U]sql queries alone[/U]? The table is a [U]non relational[/U] one and you cannot use any temporary tables...Do u think there is a possible solution for this in MS SQL Server 2000? Otherwise tell me whatever you know? …

Member Avatar for huangzhi
0
169
Member Avatar for HBMSGuy

Hello, While working on setting up user accounts, I wanted to see if the values already existed in a database to alert the user before submitting the data. While doing this, I came to an issue. The issue is when I went the MS SQL SMS and tried writing a …

Member Avatar for HBMSGuy
0
171
Member Avatar for culebrin

Hi all, I have a Stored Procedure without an output parameter but it returns one row always, this SP is called by another SP, so I need to store some of those columns in a variables of the first SP. How can I do that? Please help. P.D.: I have …

Member Avatar for culebrin
0
176
Member Avatar for dfs3000my

Hi all, I have managed to get my average using cross tabs but only if I have grouped it by their categories. If I remove the GROUP BY clause, the cross tabbing doesn't seem to work. Can anyone help me? I would need to get something like:- [CODE]Year | Month …

Member Avatar for dfs3000my
0
133
Member Avatar for nokomoli

hello Guys, I facing a sql query problem which is i need to join many query into one query. That is : a) [code=sql]SELECT sum(Total) As [MONEY1] FROM ((SELECT SUM(T1.Amount+T2.Amount) AS Total FROM TABLE1 T1 INNER TABLE2 T2 ON T1.ID = T2.ID) UNION ALL (SELECT SUM(T3.Amount+T4.Amount) AS Total FROM TABLE3 …

Member Avatar for huangzhi
0
659
Member Avatar for ffgordy

We are building a query to count the number of events per hour, per day. Most days there are hours that do not have any activity and therefore where the query is run the count of activities per hour show up but there are gaps and the query excludes these. …

Member Avatar for huangzhi
0
103
Member Avatar for mcarloskewl

i have a project of Call Management System with database SQL SERVER,now i want to limit the connected users in my database in 55 connected users only,where in this 55users can only use the system and if there is 1 user trying to connect on my database the system will …

Member Avatar for huangzhi
0
79
Member Avatar for rebeka.six

I need help with joining these two tables: Table1 idx idy --------- one 1 two 2 tree 3 Table2 idy u ------- 1 a 2 b 3 c 4 d 5 e 6 f I want to show rows from the Table1 that have idx=one joined with all the rows …

Member Avatar for rebeka.six
0
131
Member Avatar for nokomoli

Hi Guys, I have some confusing part in the sql command the question is i have 2 different query : a)[code=sql] Select SUM(T1.Amount+T2.Amount) as Total From TABLE1 T1 INNER TABLE2 T2 ON T1.ID = T2.ID[/code] b) [code=sql]Select Sum(Amount) as Total FROM TABLE3 [/code] the result if a) query is 100 …

Member Avatar for nokomoli
0
170
Member Avatar for lekfir

Hi, I am trying to break each record into 2 records but failed Is it possible? What is the correct way to do it? Thanks in advance!!! For Example: I have a table that contains 100 records . Each record has the following 10 columns: Col1, Col2, Col3, Col4, Col5, …

Member Avatar for huangzhi
0
146
Member Avatar for Jahira

Hello Sir, Can i plz have query of "Find the 6th highest salary from the table" .....plz send me d query

Member Avatar for huangzhi
0
101
Member Avatar for bugmenot

Hi everyone, I'm trying to write a stored procedure select statement which is a little beyond my experience level. I have a table in the DB called addresses which contains the following fields: [LIST] [*]address, VARCHAR [*]count, INT [*](a few more fields) [/LIST] My stored procedure will take in a …

Member Avatar for huangzhi
0
103
Member Avatar for yorks

Hi all I am pretty new to MSSQL and have a problem. The solution is probably very simple but I cant find it :) I have a database field ZIP, I also have string with consists of a number of UK part postcodes eg 'S10 S11 S7 S17 S8 S3 …

Member Avatar for huangzhi
0
206
Member Avatar for jtok

I have a datetime column in a T-SQL table that I need to sort desc. However, when I do this the NULL values for that field will show up at the bottom. I need them to be at the top of the list, while still having everything else sorted in …

Member Avatar for jtok
0
213
Member Avatar for peanutong

how do i select data from a table by sorting the first word from a column? for example: "user1 hello" "user2 one two three" "user3 where are you" "user1 im fine" how can i select all the data starting with "user1"?

Member Avatar for prasannapower
0
112
Member Avatar for newMeg

Hi, I need help on this sql. I have a table a and b and i need to select where a.id=b.id and b.mid=1 and few hardcoded a.id which does't exist in table b. i used left outer join but its still listing all in a table. Can anyone help pls. …

Member Avatar for huangzhi
0
121
Member Avatar for mhaskell

I need to write a query that will pull my products and price. However each of the products have multiple prices and I want the price with the most recent date. I have tried the following query but it doesn't work. Can someone assist me. I'm fairly new to sql …

Member Avatar for huangzhi
0
98