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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:30:40+00:00 2026-06-08T17:30:40+00:00

So I have the following: SELECT data, encrypteddata, CONVERT(varchar, DecryptByKey(encrypteddata)) AS ‘decrypteddata’ FROM table

  • 0

So I have the following:

SELECT 
    data, 
    encrypteddata,
    CONVERT(varchar, DecryptByKey(encrypteddata)) AS 'decrypteddata'
FROM table

Given the key it outputs the original data column, encrypted data column and decrypted data column as a temp column. All good.

What I have been trying to do is get that result, and just make another AS column and say Match with true or false if it is a match or not.

I’ve tried

SELECT 
    data, 
    encrypteddata,
    CONVERT(varchar, DecryptByKey(encrypteddata)) AS 'decrypteddata'
    COUNT(distinct(decrypteddata))
FROM table
WHERE COUNT (distinct(decrypteddata)) > 1 
GROUP BY data

This just gives me an error at the first COUNT about syntax.

Does anyone have a suggestion how I could do this?

  • 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-08T17:30:41+00:00Added an answer on June 8, 2026 at 5:30 pm

    try this

    SELECT 
    data, 
    encrypteddata,
    CONVERT(varchar, DecryptByKey(encrypteddata)) AS 'decrypteddata',
    COUNT(distinct(decrypteddata))
    FROM table
    WHERE COUNT (distinct(decrypteddata)) >1 group by data
    

    –Here you have used convert function-In this you have used just varchar without length parameter.So if you actual data is of more than 30 characters it will take only 30 characters and rest will be truncated.So just make sure what would be the length of your actual data.

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

Sidebar

Related Questions

I have the following problem: I select data from a DB, and for each
I'm trying to select data from the database and I have the following code
I have the following query: SELECT timestamp, COUNT(*) FROM table GROUP BY timestamp But
I have the following data SELECT T.FEED_TIME from GLRS.FEED_TYPE T 05:00:00 AM 06:00:00 AM
I have got the following exception when try to select data from SQL Server
I have the following statement: SELECT title, price FROM table WHERE id=? Should I
Let's assume we have MySQL table events from which we'll select a data. Now
I have the following query SELECT Id, Request, BookingDate, BookingId FROM Table ORDER BY
Using the following query to select data from a table in 15 minute intervals
I have the following LINQ Select which does not work. Data.Select(d => d.Value.IsDirty =

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.