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 7554061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:14:05+00:00 2026-05-30T11:14:05+00:00

How would this INSERT statement be rewritten without the subquery, so it no longer

  • 0

How would this INSERT statement be rewritten without the subquery, so it no longer results in the error “Subqueries are not allowed in this context. Only scalar expressions are allowed”?

INSERT INTO FUNCTIONAL_AREA (
  FUNCTIONAL_AREA_UUID
  ,FUNCTIONAL_CATEGORY_UUID  
  ,CREATE_DATETIME 
  ,CREATE_USER 
  ,LUPDATE_DATETIME
  ,LUPDATE_USER 
  ,DESCRIPTION
  ,ITEM_CODE
  ,IS_ACTIVE 
) VALUES ( 
 NEWID()  
 ,(select functional_category_uuid from functional_category where description = 'ADLs')
 ,GETDATE()
 ,'11111111-1111-1111-1111-111111111111'
 ,GETDATE()
 ,'11111111-1111-1111-1111-111111111111'
 ,'Bathing - Ability' 
 ,1081
 ,1)

Thank you!

  • 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-05-30T11:14:07+00:00Added an answer on May 30, 2026 at 11:14 am
    INSERT INTO FUNCTIONAL_AREA (
      FUNCTIONAL_AREA_UUID
      ,FUNCTIONAL_CATEGORY_UUID  
      ,CREATE_DATETIME 
      ,CREATE_USER 
      ,LUPDATE_DATETIME
      ,LUPDATE_USER 
      ,DESCRIPTION
      ,ITEM_CODE
      ,IS_ACTIVE 
    )
    select NEWID()  
     ,functional_category_uuid 
     ,GETDATE()
     ,'11111111-1111-1111-1111-111111111111'
     ,GETDATE()
     ,'11111111-1111-1111-1111-111111111111'
     ,'Bathing - Ability' 
     ,1081
     ,1
    from functional_category 
    where description = 'ADLs'
    

    EDIT Adding:

    If you only want one row inserted and you care about which row is selected from functional_category, then either narrow the where clause so only one row comes back, or use an order by and top 1:

    INSERT INTO FUNCTIONAL_AREA (
      FUNCTIONAL_AREA_UUID
      ,FUNCTIONAL_CATEGORY_UUID  
      ,CREATE_DATETIME 
      ,CREATE_USER 
      ,LUPDATE_DATETIME
      ,LUPDATE_USER 
      ,DESCRIPTION
      ,ITEM_CODE
      ,IS_ACTIVE 
    )
    select top 1 NEWID()  
     ,functional_category_uuid 
     ,GETDATE()
     ,'11111111-1111-1111-1111-111111111111'
     ,GETDATE()
     ,'11111111-1111-1111-1111-111111111111'
     ,'Bathing - Ability' 
     ,1081
     ,1
    from functional_category 
    where description = 'ADLs'
    order by <criteria that causes the correct row to be first>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if this would be doable ? To insert an array into one
How would I do this (the part in square brackets): $name = 'Bob'; mysql_query(INSERT
Would this be a proper way to dispose of a BackGroundWorker? I'm not sure
Under what circumstances would this or would this not be safe? I have a
I have a SQL insert statement that looks something like this? $SQL = INSERT
I want to see what my insert statement would look like as if I
I have couple of statements, the pseudo code would look something like this: insert
I have an INSERT statement that looks like this: INSERT INTO officer (officer_number, name,
When writing an INSERT statement with a lot of columns, it would be nice
Consider this statement: INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE d=d+1;

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.