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!!

Recommended Answers

All 8 Replies

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

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

Shaffer.

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

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

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

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.