Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8141551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:32:53+00:00 2026-06-06T12:32:53+00:00

I would like to fetch the result set from a function for each row

  • 0

I would like to fetch the result set from a function for each row of a parent result. Here is table1:

column
------
a1
a2
a3
a4
a5

I would like to loop through table1 and get the result of the function for each item in the column. The function returns a table.

SELECT (SELECT * FROM functionReturnsTable(a.column))
FROM (SELECT column FROM table1) a

I have tried the query above however I get the error

Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

How can I write a query/function that will loop through table1 and combine the result of each item into a single table?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:32:54+00:00Added an answer on June 6, 2026 at 12:32 pm

    Maybe something like this:

    SELECT * FROM dbo.table1 AS a
    CROSS APPLY dbo.functionReturnsTable(a.column) AS f;
    

    Though you probably wouldn’t use SELECT * in the production version, and you would probably always use schema prefix and statement terminators, right? 🙂

    Also, please stop thinking about this as a “loop”…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create a 1-liner to loop through a mysql result set. Example: $sql
My Flash movie would like communicate with MySQL server to fetch and save data
Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
Would like a for loop in jquery so that: For every hover_link: show hidden
Would like to be able to set colors of headings and such, different font
I have a table with data from the database, I would like it to
I'm trying to return a result set from a 11g Oracle table, after I've
I would like to make a query from an object I have defined that
I'm writing a set of results to an XML file. Each result set contains
Would like someone to take a look at my script and tell me where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.