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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:07:08+00:00 2026-05-26T02:07:08+00:00

Ok, I’m scrapping the old since the code has changed a lot. Here’s what

  • 0

Ok, I’m scrapping the old since the code has changed a lot. Here’s what I now have:

SELECT
   article.articleId,
   article.articleName,
   article.articleStoryTypeId,
   artIndustry.industryName,
   author.userPrefix,
   author.userMiddleName,
   article.articleStatus,
   article.articleCreateDate,
   article.articleModifyDate
FROM
   users
LEFT JOIN clickTrack
 ON users.userId = clickTrack.clickUserId
LEFT JOIN article
 ON clickTrack.clickDocumentId = article.articleId
LEFT JOIN users author
 ON author.userId = article.articleAuthorId
LEFT JOIN industry artIndustry
 ON artIndustry.industryId =    substring(article.articleIndustryId,0,charindex(',',article.articleIndustryId)-1)
WHERE ((clickTrack.clickDocumentTable = 'breaking')
     OR (clickTrack.clickDocumentTable = 'article'))
  AND article.articleCreateDate > '1/1/2008 0:00:00 AM'
  AND ((users.userindustryId = '1') 
    OR (users.userindustryId LIKE '%,1') 
    OR (users.userindustryId LIKE '%,1,%') 
    OR (users.userindustryId LIKE '1,%'))
GROUP BY
   article.articleId,
   article.articleName,
   article.articleStoryTypeId,
   artIndustry.industryName,
   author.userPrefix,
   author.userMiddleName,
   article.articleStatus,
   article.articleCreateDate,
   article.articleModifyDate
Order By article.articleId

Data returned looks like:

8332, The Ideal Situation, Breaking News, NULL, NULL, NULL, Prod, 2011-07-25 14:48:01.203, 2011-08-09 07:41:29.373

I added the commas. The 3 null fields are the industry name, user’s first name, and user’s last name. (Yes, someone named the table fields wrong.) I’m extremely tired, so I don’t know if this is enough info or not. Just let me know if you need more.

EDIT

It’s working now. I had to take the “-1” out of the left join on clause. Oh yeah, and I’m just scrapping the name fields. That’s still not working. >.< But I’m done.

  • 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-26T02:07:08+00:00Added an answer on May 26, 2026 at 2:07 am

    Is the author list really the same table as the user list? What are you trying to query for?

    One problem is that you are trying to return fields that aren’t in your group by.

    Try this:

    SELECT
       article.articleId,
       article.articleName,
       article.articleStoryTypeId,
       artIndustry.industryName,
       author.userPrefix,
       author.userMiddleName,
       article.articleStatus,
       article.articleCreateDate,
       article.articleModifyDate,
    FROM
       users
    LEFT JOIN clickTrack
     ON users.userId = clickTrack.clickUserId
    LEFT JOIN article
     ON clickTrack.clickDocumentId = article.articleId
    LEFT JOIN users author
     ON author.userId = article.articleAuthorId
    LEFT JOIN industry artIndustry
     ON artIndustry.industryId = article.articleIndustryId
    WHERE ((clickTrack.clickDocumentTable = 'breaking')
         OR (clickTrack.clickDocumentTable = 'article'))
      AND article.articleCreateDate > '1/1/2008 0:00:00 AM'
      AND users.industryId = 1
    GROUP BY
       article.articleId,
       article.articleName,
       article.articleStoryTypeId,
       artIndustry.industryName,
       author.userPrefix,
       author.userMiddleName,
       article.articleStatus,
       article.articleCreateDate,
       article.articleModifyDate,
    Order By article.articleId
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.