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

The Archive Base Latest Questions

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

Here is my query: query2 = INSERT INTO randomnusers SELECT src_ip, vlan_id, video_id, area

  • 0

Here is my query:

query2 = "
INSERT INTO randomnusers 
  SELECT src_ip, vlan_id, video_id, area 
  from video_2 
  WHERE date_pl >= '2011-11-29 00:00' AND date_pl <= '2011-12-05 23:55' 
  as table1 right join (SELECT distinct src_ip, vlan_id 
                        from video_2 
                        WHERE date_pl >= '2011-11-29 00:00' 
                          AND date_pl <= '2011-12-05 23:55' 
                        order by rand() limit 50) 
  as table2 on table1.src_ip = table2.src_ip, table1.vlan_id = table2.vlan_id"

In video_2 table, each users (use the combination of src_ip and vlan_id to identify different users) have several entries about their downloading history.

Now I want to randomly choose 50 different users, list all their downloading history in a new table called randomnusers.

But this syntax has an error around “as table1” can anyone help me to check?

Many thanks

  • 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-28T04:58:28+00:00Added an answer on May 28, 2026 at 4:58 am

    The syntax of SELECT statement is SELECT t1.name, t2.salary FROM employee AS t1, info AS t2 WHERE t1.name = t2.name;

    query2 = "INSERT INTO randomnusers (
        SELECT src_ip, vlan_id, video_id, area 
        from video_2  AS table1
    
        right join (SELECT distinct src_ip, vlan_id 
                        from video_2 
                        WHERE date_pl >= '2011-11-29 00:00' 
                          AND date_pl <= '2011-12-05 23:55' 
                        order by rand() limit 50) 
            as table2 on table1.src_ip = table2.src_ip AND table1.vlan_id = table2.vlan_id
        WHERE date_pl >= '2011-11-29 00:00' AND date_pl <= '2011-12-05 23:55')"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query here: $query='insert into pageview (visitor,id_realestate,time) select q17872745t, 150, now() from
Here is my query Select Gender from Table The result pane shows 1 1
Here is the query that I am working on: SELECT `unitid`, `name` FROM apartmentunits
Here is my Query : select EmployeeName, EmployeeSalary from Employee2 for xml path('EmployeeDetails') returns
Here's the query: INSERT INTO jobemails (jobid, to, subject, message, headers, datesent) VALUES ('340',
mysql_query (INSERT INTO `items` (`item_did_sell`, `sold_for`, `bought_by_paddle`) SELECT ('1','{$sold_for}','{$paddle_number}') FROM `items` WHERE index_number={$index_number}) or
Here is the query: INSERT INTO `users` (username, password, email) VALUES ('testu', 'testp', 'teste')
here is my query insert into invoices set Invoice_number = '823N9823', price = '11,768.00',
Here's the query: SELECT COUNT(*) AS c, MAX(`followers_count`) AS max_fc, MIN(`followers_count`) AS min_fc, MAX(`following_count`)
So firstly here's my query: ( NOTE:I know SELECT * is bad practice I

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.