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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:22:18+00:00 2026-05-25T20:22:18+00:00

I need to introduce a dummy row if my query 1 fails to fetch

  • 0

I need to introduce a dummy row if my query 1 fails to fetch result.

select column1,column2,... from <ActualTable> Where condition='abc'... (1)
Union
select "dummy col1","dummy col2"..... from <dummy table> where col1 NOT IN (select column1 from
<ActualTable> where condition = 'abc'..)                               (2)

With the above query if query 1 fetches result query 2 wont. If query 1 has no result then i would get a dummy row.

Is there any other way to achieve the same result in Sybase?

  • 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-25T20:22:18+00:00Added an answer on May 25, 2026 at 8:22 pm

    Temp table if the “ActualTable” gives >1 row

    select column1,column2,... INTO #temp
    from <ActualTable>
    Where condition='abc'... (1)
    
    IF @@ROWCOUNT = 0
        select "dummy col1","dummy col2"..... INTO #tmp
        from <dummy table>
    
    -- #temp will exist now
    
    INSERT #temp
    select column1,column2,...
    from <AnotherTable>
    Where condition='abc'... (1)
    
    IF @@ROWCOUNT = 0
        INSERT #temp
        select "dummy col1","dummy col2".....
        from <dummy table>
    
    ... 
    SELECT * FROM #tmp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a query, so before entering into question I will introduce the database
I am working on a website hwere i need to introduce security for reasons,
Need help with a query that I wrote: I have three tables Company id
Sometimes you need to introduce backward incompatibile changes, when the improvements far outweighs the
I have a JXTable where the users need to introduce data, then save it.
I'm using Kohana framework for my project development, I need to introduce new rules
I am working on a application where at some places I need to introduce
The MySQL query I'm currently trying to perform is functionally equivalent to this: SELECT
I need to introduce IPC in my applications, I also need to continue to
Often while working on a branch I need to introduce some temporary changes (such

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.