Jump to content

SQL server query experts pls come here


Rabbo

Recommended Posts

3 hours ago, Rabbo said:

I have a query which pulls 207K records,

i have to add 2 columns (month and year will be columns ) for the last 2 years 

 

a,b,c are  columns from query1 , month and year will be from query 2

 i need same rows from query1 and query 2  rows change with month and year

ila undhali result set 

a|b|c                  |month|year

207 records ki  a|b|c|nov|2019

same 207k records   a|b|c|oct|2019

and so on  upto last 2 years which will be a|b|c|nov|2017

 

so total records will be 207K * 24 =5,589 K records

 

2 hours ago, naaistamrabhai said:

question ardam kale...tables endi...data endi...

 

2 hours ago, Sarvapindi said:

U should not do that...asal req endi sakkaga seppu jara

sqlfiddle lo schema build chesthe anyone can rey vayya.. table and req artham aithale mari anadariki

Link to comment
Share on other sites

44 minutes ago, karthikn said:

 

 

sqlfiddle lo schema build chesthe anyone can rey vayya.. table and req artham aithale mari anadariki

https://stackoverflow.com/questions/1797785/sql-join-two-tables-without-keys-relations

nadhi same question as this

stackoverflow answer use crossjoins

but crossjoin works for limited records

my problem is I have 207k records in table 1, so cross join is not working

looking to see if there are any other options 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...