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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:28:21+00:00 2026-05-27T05:28:21+00:00

I have one question about LINQ, I dont know how to get the result

  • 0

I have one question about LINQ, I dont know how to get the result I need.

In my social network, I have the followers board, and I also have a search box to find the followers related by name or email.

My problem is, I dont know how to get this result. Having the Nickname or Email of the user, search the related followers.

This is my Followers table:

----------------------------
| ID | UserID | FollowerID |
----------------------------

My User table (only the columns I need)

-------------------------------------
| ID | Email | Nickname | Thumbnail |
-------------------------------------

My search box will be able to search results by Nickname or Email.

I tried to perform this query:

SELECT u.ID, u.Thumbnail, u.Nickname, u.Email
FROM dbo.[User] u
INNER JOIN dbo.Followers f
ON f.FollowerID = u.ID
WHERE f.UserID=4 and u.Nickname LIKE 'Laura'
ORDER BY u.Nickname

In this case, I would be UserID = 4, and I would be able to perform a search request of my followers…

Could anyone help me to perform this query?

  • 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-27T05:28:22+00:00Added an answer on May 27, 2026 at 5:28 am

    May be you are looking for something like this.

    Assuming that your search box contains the input Laura, I believe that you want to search the columns NickName and Email that contain the text Laura.

    LIKE '%Laura%' would return rows containing the text Laura anywhere in the column.

    LIKE 'Laura%' would return rows where the column text begins with text Laura.

    Simply having LIKE 'Laura' would return only rows that exactly match the text Laura.

    SELECT      u.ID
            ,   u.Thumbnail
            ,   u.Nickname
            ,   u.Email
    FROM        dbo.[User]      u
    INNER JOIN  dbo.Followers   f
    ON          f.FollowerID    = u.ID
    WHERE       f.UserID        = 4 
    AND         (
                        u.Nickname  LIKE '%Laura%'
                    OR  u.Email     LIKE '%Laura%'
                )
    ORDER BY    u.Nickname
    

    Sample data:

    Sample

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

Sidebar

Related Questions

I have one question about Yii framework, and I need your help. Basicly, I
I have asked this question about using the a Linq method that returns one
I have a question about the result of LINQ and Lambda query. For example,
I have one question about searching and counting files in directories and subdirectories. I
I have a question about best practices regarding how one should approach storing complex
I have a question about Criteria method, one-to-many relation to the database, 'one' is
I have a basic question about implementing a Entity code first one to many
This is likely a novice question about LINQ, but assuming I have a set
I have a question about joins when using Linq to Entities. According to the
I am new to LINQ and EF and I have a quick question about

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.