| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
need a SQL queryHi,
I am using Oracle 10g, I have the following requirement: I want fetch the count of all position patterns with in a number pool. For e.g if there is a database table with SNO and status as the DB columns, the data representation is as follows: SNO, STATUS ------------------- 1, Y 2 , Y -- , -- 100, Y assuming that the table has records from 1 to 100. I want to write an optimized SQL query which will list out the count of numbers starting with 1,2,3 .... 100 Start with, Count ------------------- 1 , 12 (there are 12 numbers between 1 to 100 which start with 1) 2 , 11 -- , -- 10 , 2 Thanks and Regards Jay Last edited by jayyu_l : 06-25-2009 at 01:53 PM. |
|
|||
|
select sno, count(*)
from your_table group by sno ; |
|
|||
|
SIR,
i have two tables one is q_bank and another is blueprint in q_bank i have col subject question and category(A,B,C) in blueprint i have the no for A,B,C(01,01,02) now i need a query so that output should be question and category but no of rows are decided by values of A,B,C from blueprint table q_bank table for example - question subject cat define x x A define y y B define z x A define 1 y A define2 x B define n x C define t y C blueprint subject A B C X 1 0 1 y 2 1 0 my requirement that query should give question from q_bank and no of question should be limited by numbers of A,B,C of blueprint thanx kindly help me out my emailid-anil.1974@yahoo.com Last edited by anil : 08-01-2009 at 05:32 AM. |
|
|||
|
Quote:
sir, i have made myself more clear kindly help me out |