subselect query

Results 1 to 3 of 3

Thread: subselect query

  1. #1
    pillai Guest

    Default subselect query

    Hello all,<BR> Can anyone help me with my problem. I have to write asp code which has to uses subselect. My code is like this.<BR><BR> Select * from table1 where feildone in ( select fieldone,count(*) from table1 where &#039;some criteria&#039; group by fieldone having count(fieldone)&#062;1)<BR> <BR><BR> I tried this but I got the following error<BR> Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.<BR><BR> Please help me it is urgent.<BR><BR>Thank you <BR>Pillai<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: subselect query

    In your subquery, you cannot have more then one field in your SELECT statement. Your subquery should be like this:<BR>SELECT count(*) FROM table1 WHERE &#039;Some Criteria&#039; GROUP BY fieldone

  3. #3
    pillai Guest

    Default RE: subselect query

    thank you very much. It helped a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts