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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:07:58+00:00 2026-05-17T22:07:58+00:00

I am running the simple query below select ”” + event_number + ”” +’,’

  • 0

I am running the simple query below

select  '''' + event_number + '''' +',' as Event_N
from mytable

which gives:

Event_N
---------------
'BAB0910000001',
'CDD0910000002',
'ODB0910000002',
'YDB0910000003',
'NYC0910000004',

Question 1: Is there a way in SQL that can show the result as:

Event_N
'BAB0910000001','CDD0910000002','ODB0910000002','YDB0910000003','NYC0910000004',

I could do a dirty step by pressing Delte and End but would not be efficient when more than 100 records.

I am using Aqua Data Studio 7.5.34 and the back end is MS SQL Server 2000/5/8.

Event_number data type is varchar.

Question 2: But when I tried to run this query, it showed me the error below. Could someone please help!!!

select  '''' + event_key + '''' +',' as Event_K
from mytable

I am using Aqua Data Studio 7.5.34 and the back end is MS SQL Server 2000/5/8.

–event_key data type is int.

[Error] Script lines: 1-3 ————————–
Conversion failed when converting the varchar value ”’ to data type int.
Msg: 245, Level: 16, State: 1, Procedure: , Line: 1


I ran the following query, which gives:

select ''''||EVENT_KEY||'''' as Event_K
from mytable

EVENT_K
'28732033'
'28797708'
'28796943'
'28133100'
'28718239'

Question 3: Is there a way in SQL that could add a comma (,) to the end of these records and output the result similar to question 1?

I am using Aqua Data Studio 7.5.34 and the back end is oracle 8i

  • 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-17T22:07:58+00:00Added an answer on May 17, 2026 at 10:07 pm

    Question 1 and 3 – essentially the same as this question: Use SQL instead of Delete and End from keyboard

    OMG Ponies’ post includes links to a selection of techniques in Oracle, as well as SQLServer.

    Question 2 requires an explicit CAST or CONVERT on the event_key, to change it into character instead of numeric data – like so:

    select  '''' + convert(varchar,event_key) + '''' +',' as Event_K
    from mytable
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The query I am running is select accountid from general order by accountid ASC
I have a single DB table (MySQL) which I am running a simple SELECT
I'm running a simple batch file which is generated by a vbscript to delete
Let's say I'm running a simple server and have accept() ed a connection from
Running the below select on a MySql table containing 1500000 rows will take approximately
I am running a query from my java based web app running in a
When running the follow query i receive the error below, Im just trying to
I'm writing a simple dictionary app which gives suggestions for words as you type.
simple query causes ora - 01013 error select count (*) as counter, 'month_stat' as
I am using running a simple find all and paginating with willpaginate, but I'd

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.