0

hye...im having difficulities to retrieve data from one table. i need to retrieve data from few columns and multiple rows in one table and display it the data. is there any way of doin it?
urgent help need!!

4
Contributors
8
Replies
9
Views
10 Years
Discussion Span
Last Post by jayz_raul
0

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!

select 
    columnname1, columnname2 
from 
    table name 
where 
   columnname = somevalue
0

Hello,
I need to know how many rows, and by what parameters, so that I can help you.

Shaffer.

0

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

0

thankz for ur reply... i already had the whole code for retrieve the data
im trouble to retrieve certain column and also i cant retrieve all the data.
i'll try annyway..

0

i olready reply what exactly my problem. anyway thankz for u reply...

0

Hello,
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.

0

it works for unique values. but i cant retrieve all from sub_code and gred. Any idea on why?
i only can retrieve one row

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.