QUERY [message #190564] |
Thu, 31 August 2006 05:05 |
sam4all
Messages: 29 Registered: August 2006 Location: Bangalore
|
Junior Member |
|
|
Hi
Is this correct query
select count(*) from t where age_group = '41 and over' and gender = 'F';
regards,
SAM
|
|
|
Re: QUERY [message #190567 is a reply to message #190564] |
Thu, 31 August 2006 05:07 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Well, assuming that you have the required privileges to see a table called T, and that table contains two columns of type CHAR or VARCHAR2, one called AGE_GROUP and the other called GENDER, then your query should parse and execute.
Whether it gets the right results is a question only you can answer.
|
|
|
Re: QUERY [message #190570 is a reply to message #190564] |
Thu, 31 August 2006 05:10 |
gbarbisan
Messages: 67 Registered: August 2006 Location: Treviso - Italy
|
Member |
|
|
SQL> DROP TABLE T;
Tabella eliminata.
SQL> CREATE TABLE T (AGE_GROUP VARCHAR2(50), GENDER VARCHAR2(1));
Tabella creata.
SQL> INSERT INTO T VALUES('41 and over','F');
Creata 1 riga.
SQL> commit;
Commit completato.
SQL> SELECT COUNT(*)
2 FROM T
3 WHERE AGE_GROUP = '41 and over'
4 AND GENDER = 'F'
5 /
COUNT(*)
----------
1
SQL>
Be aware that SQL is case sensitive!
SQL> SELECT COUNT(*)
2 FROM T
3 WHERE AGE_GROUP = '41 AND OVER'
4 AND GENDER = 'F'
5 /
COUNT(*)
----------
0
SQL>
|
|
|
|
|
|