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

  • Home
  • SEARCH
  • 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 6654959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:27:17+00:00 2026-05-26T01:27:17+00:00

Here is my current sql query SELECT w.city, t.tmc, t.date, t.time, w.event, ROUND(AVG(w.Pave), 0)

  • 0

Here is my current sql query

        SELECT 
    w.city, t.tmc, t.date, t.time, w.event, 
    ROUND(AVG(w.Pave), 0) surface_temperature, 
    ROUND(AVG(w.Air), 0) air_temperature, 
    ROUND(AVG(a.material_rate),0) material_rate, 
    w.intensity, t.avg 
    FROM winter2010.traffictest t 
    LEFT OUTER JOIN winter2010.application a ON a.DATE = t.DATE AND a.tmc = t.tmc AND a.tmc = t.tmc AND Left(a.time,2) = Left(t.time, 2) 
    LEFT OUTER JOIN winter2010.weather w ON t.DATE = w.DATE AND t.tmc = w.tmc AND  Left(t.time, 2) =  Left(w.time, 2) 
    GROUP BY tmc, t.time 
    INTO OUTFILE 'c:/sass2.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES 
TERMINATED BY '\n';

I’m creating this csv file from the following sql statement and it works great except for one thing, its only taking 1/2 the rows!

There are a total of 2661 rows in traffictest
And when I outfile the data into the csv its only putting 1331.

I’ve changed the size of traffictest and this holds true except when I had only 3 rows it actually pulled all three rows.

Any help figuring this out would be much appreciated.

  • 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-26T01:27:17+00:00Added an answer on May 26, 2026 at 1:27 am

    When you use GROUP BY MySql returns only one row per group, You have rows with similar tmc-time and MySql is returning only one row for all such rows that’s the reason for decrease in row number.

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

Sidebar

Related Questions

First off, here's my SQL query: SELECT research_cost, tech_name, (SELECT research_cost FROM technologies WHERE
Here is my current code: $sql = SELECT * FROM user_posts; $result = mysql_query($sql);
Here is my current, working, query: var lsFooterRow = from i in _context.Inventory where
I want to implement following logic in my SQL query: If some date is
I am trying to develop a T-SQL query which will do the following: ROUND(100
I intended to do another SQL query inside here and retrieve data from another
Here is the updated question: the current query is doing something like: $sql1 =
Here is my current setup: Database Role - MyDbRole Schema - MySchema User -
here is my current line of code: $(<li>).text($(this).text()).appendTo(#theList); Which results in <ul id=theList> <li>blah</li>
Here is the current code I am using: <UserControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=ButtonPrototype.MainPage Width=640 Height=480>

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.