Replies: 17
| visibility 6
|
Heisman Winner [86941]
TigerPulse: 100%
62
Posts: 26916
Joined: 2012
|
Any yoo ####### know SQL?
6
6
May 24, 2023, 1:39 PM
|
|
Maybe looking to do a join statement but I program exclusively in Excel.
FYT
|
|
|
 |
Clemson Sports Icon [52627]
TigerPulse: 100%
59
Posts: 33314
Joined: 2015
|
Save Qatthews Land?***
6
6
May 24, 2023, 1:40 PM
|
|
|
|
|
|
 |
Top TigerNet [30196]
TigerPulse: 100%
55
Posts: 11633
Joined: 2011
|
better than most
2
May 24, 2023, 1:40 PM
|
|
|
|
|
|
 |
Top TigerNet [30196]
TigerPulse: 100%
55
Posts: 11633
Joined: 2011
|
send me the two tables
1
May 24, 2023, 1:41 PM
|
|
the two primary keys
the fields you want
and the type of join you want
|
|
|
|
 |
Heisman Winner [86941]
TigerPulse: 100%
62
Posts: 26916
Joined: 2012
|
Re: send me the two tables
May 24, 2023, 1:43 PM
|
|
2 tables: -item master (primary key is SKU) -product code (Primary key is product code)
Product code is a field on the item master, but I want details from the product codes table for a field called saleable items
|
|
|
|
 |
Clemson Sports Icon [52627]
TigerPulse: 100%
59
Posts: 33314
Joined: 2015
|
Somebody is trying to make store manager at the k-mart***
1
May 24, 2023, 1:48 PM
|
|
|
|
|
|
 |
TigerNet Legend [147200]
TigerPulse: 100%
67
Posts: 94646
Joined: 1998
|
Somebody is worried about their new manager at the k-mart***
1
May 24, 2023, 1:59 PM
|
|
|
|
|
|
 |
Orange Immortal [66581]
TigerPulse: 100%
60
Posts: 24337
Joined: 2005
|
Re: send me the two tables
1
May 24, 2023, 2:02 PM
[ in reply to Re: send me the two tables ] |
|
Not positive in reading this right, but something like this...
select a.item master , b.product code , b.saleable items from item master as a inner join product code as b ON a.SKU = b.SKU
|
|
|
|
 |
Top TigerNet [30196]
TigerPulse: 100%
55
Posts: 11633
Joined: 2011
|
that should work
May 24, 2023, 2:29 PM
|
|
depending on the iventory system you're using. Which one Tickle_It?
typically you have an Item_id that's the primary key for the item tables.
|
|
|
|
 |
Top TigerNet [30196]
TigerPulse: 100%
55
Posts: 11633
Joined: 2011
|
try this....just re-reading
1
May 24, 2023, 2:32 PM
|
|
select im.SKU, pc.saleable_items from item_master im inner join product code pc on im.product_code = pc.product_code;
|
|
|
|
 |
Heisman Winner [86941]
TigerPulse: 100%
62
Posts: 26916
Joined: 2012
|
Nothing to do with inventory. Butt I took the easy way out
May 24, 2023, 4:12 PM
[ in reply to that should work ] |
|
lutz I had lunch with a programmer and he's going to add that field to my current view that I'm pulling for my BI utility. At some point I'll learn more SQL.
|
|
|
|
 |
Orange Immortal [65180]
TigerPulse: 100%
60
Posts: 22741
Joined: 2004
|
duh, you ruhtard
2
May 24, 2023, 2:04 PM
[ in reply to Re: send me the two tables ] |
|
SELECT im.SKU, im.saleable_items, pc.saleable_items FROM item_master im JOIN product_codes pc ON im.product_code = pc.product_code;
In this example, we're using the JOIN clause to combine the "item master" table (item_master) with the "product codes" table (product_codes) based on the common field product_code. We select the SKU number (im.SKU), the saleable items field from the "item master" table (im.saleable_items), and the saleable items field from the "product codes" table (pc.saleable_items).
Make sure to replace item_master and product_codes with the actual table names in your database. Additionally, adjust the column names (SKU, product_code, saleable_items) to match your schema.
|
|
|
|
 |
Heisman Winner [86941]
TigerPulse: 100%
62
Posts: 26916
Joined: 2012
|
U 4 Reel?
May 24, 2023, 1:41 PM
[ in reply to better than most ] |
|
I thought you worked in Sales?
|
|
|
|
 |
Top TigerNet [30196]
TigerPulse: 100%
55
Posts: 11633
Joined: 2011
|
just recently got into sales
May 24, 2023, 3:14 PM
|
|
6 years in software design / engineering
4 years in building buildings
all supply chain / warehousing related.
SQL is my #####
|
|
|
|
 |
Oculus Spirit [42340]
TigerPulse: 100%
57
Posts: 21515
Joined: 2022
|
ChatGPT.***
1
May 24, 2023, 2:00 PM
|
|
|
|
|
|
 |
Orange Elite [5357]
TigerPulse: 100%
38
|
Re: Any yoo ####### know SQL?
2
May 24, 2023, 2:05 PM
|
|
Here's what Bard says, I don't do much with SQL so have no idea how to judge it's output:
Sure, here is the SQL join statement you can use:
SQL SELECT item_master.SKU, item_master.ProductCode, product_codes.SaleableItems FROM item_master INNER JOIN product_codes ON item_master.ProductCode = product_codes.ProductCode; Use code with caution. Learn more This will return all rows from the item_master table, and the corresponding rows from the product_codes table where the ProductCode column is equal. The SaleableItems column from the product_codes table will be included in the result set.
Here is an example of the output of this query:
Code snippet SKU | ProductCode | SaleableItems ------- | -------- | -------- 123456 | ABC123 | Yes 789012 | DEF456 | No
|
|
|
|
 |
Clemson Sports Icon [52772]
TigerPulse: 100%
59
Posts: 32631
Joined: 1999
|
Kinda reminds me of "Fast Times at Ridgemont High"
1
May 24, 2023, 3:00 PM
|
|
|
|
|
|
 |
Ultimate Clemson Legend [108410]
TigerPulse: 100%
64
Posts: 70373
Joined: 2002
|
Tigermemories used a MySQL database
May 24, 2023, 8:11 PM
|
|
But no, it's greek to me. I can use it, but the coding is greek to me.
|
|
|
|
Replies: 17
| visibility 6
|
|
|