•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 402,728 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,424 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 1403 | Replies: 8
![]() |
•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,165
Reputation:
Rep Power: 7
Solved Threads: 58
Sql Server 2000 or 2005 ? I ask as it depends what GUI to use for the following TSQL code. Sql 2000 Start->Programs->Ms Sql Server->Query Analyser File->Connect click OK, select the database name in the drop down box, paste the code in, clcik the green play icon in the toolbar or press F5 key. For Sql 2005 Start -> programs -> Ms Sql Server 2005 -> Sql Server Managent Studio Click New Query in toolbar, select the database in the drop down box, past the code in the query pane on the right, click execute button.
You need obviously to overtype the column names and table names and criteria as I had to make those up cos you didn't post enough info! Naughty you!
You need obviously to overtype the column names and table names and criteria as I had to make those up cos you didn't post enough info! Naughty you!
select
columnname1, columnname2
from
table name
where
columnname = somevalue Last edited by hollystyles : Sep 21st, 2007 at 4:35 am.
ok..here further information about my table structure.
Table : Results
Metric_Num, Sub_Code, Gred, GPA, CGPA, Status
12345 TMM10011 A 3.00 2.99 PASS
Above is columns under table Results. So now I need to retrieve all data’s under a particular metric number. Means if I request 12345, all the data should be displayed but Gpa, Cgpa and Status must be displayed only once.
The Output should be like this:
TMX2011 B,TMN 2013 A 3.00 3.00 lulus
Table : Results
Metric_Num, Sub_Code, Gred, GPA, CGPA, Status
12345 TMM10011 A 3.00 2.99 PASS
Above is columns under table Results. So now I need to retrieve all data’s under a particular metric number. Means if I request 12345, all the data should be displayed but Gpa, Cgpa and Status must be displayed only once.
The Output should be like this:
TMX2011 B,TMN 2013 A 3.00 3.00 lulus
I don't know, try looking at a tutorial maybe?
http://www.intermedia.net/support/sql/sqltut.asp
Or were you expecting someone to write every sql query you dream up from you?
http://www.intermedia.net/support/sql/sqltut.asp
Or were you expecting someone to write every sql query you dream up from you?
Member of: F-ugly code club
Join today don't delay!
Join today don't delay!
•
•
Join Date: Mar 2007
Location: Israel
Posts: 16
Reputation:
Rep Power: 2
Solved Threads: 1
Hello,
I hope this will work for you:
Happy Jewish New Year!
Shaffer.
I hope this will work for you:
SELECT * FROM table_name WHERE Metric_Num='12345' AND UNIQUE(GPA) AND UNIQUE(CGPA) AND UNIQUE(Status);
Happy Jewish New Year!
Shaffer.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access ajax asp breach broadband code combo crime daniweb data data protection data transfer database developer development drive dropdownlist forensics government hacker hard hardware hitachi internet linux microsoft module msdn net news office reuse security software sql storage survey terabyte vista web wikipedia
- retrieve data from database into jsp(urgent)!!! (Oracle)
- how to store and retrieve data from cookies (ASP.NET)
- VB.Net: Problem Retrieve data from ListView (VB.NET)
- How to retrieve data from a dynamically generated radio button (ASP.NET)
- retrieve data by VB.Net (VB.NET)
- Retrieve the data from the url api (RSS, Web Services and SOAP)
- Login and retrieve user data from database (ASP.NET)
- please help! this is urgent> how to retrieve data to my tabpage without using data fo (C#)
Other Threads in the MS SQL Forum
- Previous Thread: DTS on MSSQL 2005 Express edition
- Next Thread: Reporting Services



Linear Mode